复制代码 1 2 Fork me on GitHub 6 1 2 Fork me on GitHub 6

C语言的框架

1 /* hello world C语言程序的一般组成
2 多行注释*/
3 #include <stdio.h>// #表示预处里,<stdio.h>标准输入输出函数
4 int main() //程序的主入口
5 {    //开始
6     printf("hello,world");//单行注释
7     return 0;  返回 0 
8 }// 结束

 C语言的编译过程解析:

 初探函数

参数    返回(return) 函数调用(CALL)

 Key Point 1:return语句表示函数结束,其后语句不执行

1 #include <stdio.h>
2 int mian()
3 {
4     return 0; //函数结束,其后语句不执行。
5     printf("helle,world");
6 } 

 Key Point 2:

int main() 表示所产生的可执行文件,在执行完成后向命令系统返回的数值为一个整型数,系统会根据这个返回值选择某种操作或反馈,通常,返回0时指的是正常退出,返回1时指的是异常退出。

Key Point 3:以#开头的都是预编译指令,在编译前统一执行,无需分号结尾

Key Point 4:#include: 预编译指令“包含”,作用为整体复制头文件进入该行.

Key Point 5:函数是C语言的基本组成单位

Key Point 6:C程序必须有且只有一个main函数,它是程序入口,万恶之源  

 

posted @ 2021-06-26 12:54  浅草小子  阅读(1900)  评论(0)    收藏  举报
1