ºìÁªLinuxÃÅ»§
Linux°ïÖú

´íÔÚÄÄÀï°¢£¿

·¢²¼Ê±¼ä:2009-03-25 12:17:17À´Ô´:ºìÁª×÷Õß:ghostlpc
//Copy the string
#include
#include

int main(void)
{
char *apple = "Hello,world!";
char *pear;

while((*pear++ = *apple++) != '\0')
;

exit (0);
}

´ó¼Ò°ïÎÒ¿´¿´°¢ £¬ÀÏÊdzö´í£¬ÊÇÔÚûÓиãÃ÷°×
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 6 ÌõÆÀÂÛ

  1. 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;
    }

  2. bournewang ÓÚ 2009-03-25 16:10:56·¢±í:

    ÊÇÕâ¸öµØ·½µÄÔ­Òòchar *pear;ûÓнøÐгõʼ»¯¾Í¸³ÖµÊDz»Ðеġ£

  3. ghostlpc ÓÚ 2009-03-25 15:59:08·¢±í:

    ÕÒµ½´ð°¸ÁË£¬×Ô¼ºÏëÁËÒ»½Ú¿Î£¬Ã÷°×ÁË £¡

  4. ghostlpc ÓÚ 2009-03-25 13:26:33·¢±í:

    ÎҸоõÕâôûÓÐ´í°¡£¬µ«ÊÇÌáʾ¶Î´íÎ󣬸øÎÒ¿´¿´°¡

  5. zhaoyuzhong3694 ÓÚ 2009-03-25 13:25:09·¢±í:

    ¸çÃǵÄCÓïÑÔ»¹Êdzõ¼¶£¬²»¶®£¬Í¬ÇéÖС­¡­

  6. deepwhite ÓÚ 2009-03-25 12:59:37·¢±í:

    ˭дµÄ£¿
    ɶѽÕâÊÇ¡­¡­