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