I have that code:
#include<stdio.h>
int main()
{
char *str = "aaaaaaaa";
char *stt = "bbbbbbbb";
*str = *stt;
printf("%s\n", str);
return 0;
}
it gives me an error: Access violation writing location, someone can explain me why and how to over come this?
*str = *stt;is the same asstr[0] = stt[0];which attempts to copy the first element from one place to another.