I’m having trouble removing the first two characters from my char array.
input[MAXSIZE] = "./hello";
for(int i = 2; i < MAXSIZE; i+=2)
{
strcpy(input[i-2],input[i]);
}
and I’m getting the following errors:
invalid conversion from ‘char’ to ‘char*’
initializing argument 1 of ‘char* strcpy(char*, const char*)’
invalid conversion from ‘char’ to ‘const char*’
initializing argument 2 of ‘char* strcpy(char*, const char*)’
I know that this is a very basic problem but im fairly new to this.
Also if there is an easier way to get around this problem feel free to educate me.
strcpycopies null terminated char arrays, not characters.What you want is:
Also, why don’t you increment
iwith1but with2?