I am trying to understand why this works:
char myst1r[] = "hello\n";
memmove(myst1r , myst1r + 1 , 1 );//results in "eello"
while this one :
char *mystr = "hello\n";
memmove(mystr , mystr + 1 , 1 );
results in "Access violation writing location" error.
Don't both myst1r
and mystr
point to the first member of char buffer? What do I miss here?