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
Change
char* string = "abcdefghijk";
to
char string[] = "abcdefghijk"
The former points to a read-only string literal, whereas the later is an array initialized from that literal.