The code was suppose to rotate a one-dimensional vector of n elements left by i position. for instance, with n=8 and i = 3, the vector abcdefgh is rotated to defghabc.
T
If you want to use a string to manipulate on, use a real character array rather than a character pointer.
char string[] = "abcdefghijk";