1

How can this code printf() properly although I allocated less memory than it requires.

char* String;
char String2[] = "testing";
String =(char*) malloc(4 * sizeof(char));
strcpy(String,String2);
printf("NAME : %s",String);
keser
  • 2,472
  • 1
  • 12
  • 38

0 Answers0