mickey2005
Banned
1. What will print out?
2. main()
3. {
4. char *p1="name";
5. char *p2;
6. p2=(char*)malloc(20);
7. memset (p2, 0, 20);
8. while(*p2++ = *p1++);
9. printf("%s\n",p2);
10. }
Answer:empty string.
2. main()
3. {
4. char *p1="name";
5. char *p2;
6. p2=(char*)malloc(20);
7. memset (p2, 0, 20);
8. while(*p2++ = *p1++);
9. printf("%s\n",p2);
10. }
Answer:empty string.