Hi,
I'm trying to shift all elements of a string to the left (so the first letter is cut off) one-by-one until the end of the string
Code:
#include <stdio.h>
#include <string.h>
int main(){
char string1[32] = "This is a string", string2[32], string3[32], string4[32];
int i, j, k;
for(i = 0; i < 32; i++){
string2[k] = string1[0];
string1 << 1;
printf("%c", string2[k]);
}
}
This is what I have so far but I get an error when compiling the program that says this:
stringmaniptest.c: In function ‘main’:
stringmaniptest.c:9:14: error: invalid operands to binary << (have ‘char *’ and ‘int’)
string1 << 1;
^
Would anyone be able to advise me on how to fix this?
Thanks