char or string issues

My code is shown below

char buffer[10000]10000]

while(x != 1)
{
buffer[x]=buffer[x-1];
x--;
Fout_buffer = fopen("c:\\OS2\\buffer.txt", "a");
fprintf(Fout_buffer,"%s\n", buffer[line_buffer]);
}

After I execute, there's error Lvalue required
my question is, any problem with char n buffer[x]=buffer[x-1] ?

thanks :)
If you have an array, "char foo[50]", "foo" is a char* to it's first element. This is a constant and not a variable. What you have is the same. While buffer is a 2d array, buffer[x] is one of it's rows. You can't assign a pointer to (constant) pointer and expect it to copy all elements. You have to use memcpy, std::copy or a for loop.
Topic archived. No new replies allowed.