欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: 字符串技巧 [打印本頁]

作者: xiaojuan    時間: 2014-9-17 14:35
標題: 字符串技巧
#include<stdio.h>

void put1(const char *); //const在這里屬于一個加強的作用
int put2(const char *);

int main (void)
{
put1("If I'd as much money");
    put1("as I could spend\n");
printf ("I count %d characters.\n",
   put2("I never would cry old chairs to mend"));   //得到的結果按照輸出順序,先輸出里面的字母,在輸出個數

return 0;
}

void put1(const char * string)
{
while (*string)    //這句話的含義相當于while (*string != '0')
  putchar (*string++);
}

int put2(const char * string) //指針的使用可以輸出里面的東西
{
int count = 0;
while (*string)
{
  putchar (*string++);
// printf ("%s",*string++);
// printf ("haha");              可以輸出
  count++;
}
putchar ('\n');

return(count);
}






歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1