Posts by humbertovaz • 43 points
1 post
-
4
votes1
answer96
viewsQ: Why not give Segmentation fault when writing to a "char *" without allocating memory?
My question is whether the compiler automatically allocates memory to the variable s1 char *s1; char s2[20]; //s1=(char*)malloc (sizeof(char)*20); s1="palavra1"; strcpy (s2,"palavra2");…