I just did some test. See the program below:
===============================
#include
#include
#include
int main(int argc, char* argv[])
{
char *a="abcde";
char b[]="abcde";
char* c=(char*)malloc(6);
strcpy(c, a);
printf("%lx, %lx, %lx\n", a, b, c);
printf("%c %c %c\n", a[0], b[0], c[0]);
a[0] = 'f';
printf("%s\n", a);
return 0;
}
==============================
output:
80486d0, bfc74b96, 804b008
a a a
Segmentation fault
char *a="abcde", the compiler generate a str