@第一个程序
程序框架
刚开始学的C语言大部分都是这个框架
#include <stdio.h>
int main(){
return 0;
}
-
#include <stdio.h> 是预处理器指令。
-
stdio.h是系统提供的一个文件名,stdio是standard input &output 的缩写,文件后缀 .h的意思是头文件(header file),因为这些文件都是放在程序各文件模块的开头。
-
int main() 是主函数,程序从这里开始执行。
-
" " 号中的是字符串。
-
printf是输出,将" "号中的东西原封不动输出。注意:其后面需要跟上分号,不然报错。
-
所有的标点符号需要用英文字符,但在" "中是无所谓的。
#include <stdio.h>
int main(){
printf("hello,how are you?") ;
return 0;
}
输出的结果 hello,how are you?