C语言(二) C 程序结构

1.C 程序主要包括以下部分:

  • 预处理器指令
  • 函数
  • 变量
  • 语句 & 表达式
  • 注释 

2.Hello World 实例

/*#include <stdio.h> 是预处理器指令,告诉 C 编译器在实际编译之前要包含 stdio.h 文*/
/*stdio.h也就是C语言的有关标准输入流输出流的头文件*/
#include <stdio.h>

/*主函数,程序从这里开始执行*/ 
int main()
{
   /* printf 输出 Hello, World!*/
   printf("Hello, World! \n");

   /*终止 main() 函数,并返回值 0*/
   return 0;
}

猜你喜欢

转载自blog.csdn.net/liu362732346/article/details/81875456