<code>
#include <stdio.h>
/* 考慮一下哪個(gè)輸出該用無參函數(shù)哪個(gè)輸出該用有參函數(shù)呢? */
int print()
{
? ? puts("小明在慕課網(wǎng)上學(xué)習(xí)"); ??
? ? return 1;
}
int printCount(int n)
{
? ? ?printf("小明在慕課網(wǎng)上已經(jīng)參與學(xué)習(xí)了%d門課程",n);?
}
int main()
{
? ? int numOfCourse = 0;
? ? numOfCourse += print();
? ? printCount(numOfCourse);
? ? return 0;
}
2015-02-15
有的學(xué)習(xí)資料中說:常用的字符串處理函數(shù)包括puts(字符數(shù)組)、gets(字符數(shù)組)、strcpy(字符數(shù)組1,字符數(shù)組2)、strcat(字符數(shù)組1,字符數(shù)組2)、strcmp(字符數(shù)組1,字符數(shù)組2)、strlen(字符數(shù)組)。在使用它們前必須在文件開始處用#include<string.h>命令將相關(guān)的頭文件包含到源程序中。
2015-02-07
需要注意:如果調(diào)用puts()函數(shù),文件的開頭必須有預(yù)處理命令#include<string.h>