zha2530 ÓÚ 2009-03-25 20:32:28·¢±í:
#include #include #include int main(void) { char *apple = "hello,linux!"; char *pear=NULL; char *a; static char *p; a=apple; p = pear = (char *)malloc(strlen(apple)); while(*apple) { *pear=*apple; apple++; pear++; } *pear='\0'; printf("apple = %s\n",a); printf("pear = %s\n",p); return 0; }
bournewang ÓÚ 2009-03-25 16:10:56·¢±í:
ÊÇÕâ¸öµØ·½µÄÔÒòchar *pear;ûÓнøÐгõʼ»¯¾Í¸³ÖµÊDz»Ðеġ£
ghostlpc ÓÚ 2009-03-25 15:59:08·¢±í:
ÕÒµ½´ð°¸ÁË£¬×Ô¼ºÏëÁËÒ»½Ú¿Î£¬Ã÷°×ÁË £¡
ghostlpc ÓÚ 2009-03-25 13:26:33·¢±í:
ÎҸоõÕâôûÓÐ´í°¡£¬µ«ÊÇÌáʾ¶Î´íÎ󣬸øÎÒ¿´¿´°¡
zhaoyuzhong3694 ÓÚ 2009-03-25 13:25:09·¢±í:
¸çÃǵÄCÓïÑÔ»¹Êdzõ¼¶£¬²»¶®£¬Í¬ÇéÖС¡
deepwhite ÓÚ 2009-03-25 12:59:37·¢±í:
ËдµÄ£¿ ɶѽÕâÊÇ¡¡
zha2530 ÓÚ 2009-03-25 20:32:28·¢±í:
#include
#include
#include
int main(void)
{
char *apple = "hello,linux!";
char *pear=NULL;
char *a;
static char *p;
a=apple;
p = pear = (char *)malloc(strlen(apple));
while(*apple)
{
*pear=*apple;
apple++;
pear++;
}
*pear='\0';
printf("apple = %s\n",a);
printf("pear = %s\n",p);
return 0;
}
bournewang ÓÚ 2009-03-25 16:10:56·¢±í:
ÊÇÕâ¸öµØ·½µÄÔÒòchar *pear;ûÓнøÐгõʼ»¯¾Í¸³ÖµÊDz»Ðеġ£
ghostlpc ÓÚ 2009-03-25 15:59:08·¢±í:
ÕÒµ½´ð°¸ÁË£¬×Ô¼ºÏëÁËÒ»½Ú¿Î£¬Ã÷°×ÁË £¡
ghostlpc ÓÚ 2009-03-25 13:26:33·¢±í:
ÎҸоõÕâôûÓÐ´í°¡£¬µ«ÊÇÌáʾ¶Î´íÎ󣬸øÎÒ¿´¿´°¡
zhaoyuzhong3694 ÓÚ 2009-03-25 13:25:09·¢±í:
¸çÃǵÄCÓïÑÔ»¹Êdzõ¼¶£¬²»¶®£¬Í¬ÇéÖС¡
deepwhite ÓÚ 2009-03-25 12:59:37·¢±í:
ËдµÄ£¿
ɶѽÕâÊÇ¡¡