#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void main()
{
char* p1 = "aaa";
char* p2, *tm;
p2 = (char*)malloc(30);
memset(p2, 0, 30);
tm=p2;
while (*p2++ = *p1++);
printf("%s\n",tm);
}
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void main()
{
char* p1 = "aaa";
char* p2, *tm;
p2 = (char*)malloc(30);
memset(p2, 0, 30);
tm=p2;
while (*p2++ = *p1++);
printf("%s\n",tm);
}