您当前的位置: 首页 >  c语言
  • 4浏览

    0关注

    880博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

一个例子教给你C语言的基本组成

CodeAllen嵌入式编程 发布时间:2021-05-04 22:57:43 ,浏览量:4

我是Allen,我的公众号是【CodeAllen】,关注回复【1024】获取资源,程序员技术交流①群:736386324

C语言虽然内容比较多,但是其基本成分其实不多的,其他编程语言也都类似,所以就借着一个最简单的例子梳理下C语言的基本成分

#include 

int main()	
{
	/*_some_comments_*/	
	printf("Hello_World!");	
	getch();	
	return 0;	
}	

下面是逐句分析

 

#include 

This command includes standard input output header file(stdio.h) from the C library before compiling a C program

在编译C程序之前,此命令包括C库中的标准输入输出头文件(stdio.h)

 

int main()   

It is the main function from where C program execution begins.

它是C程序开始执行的主要功能。

 

{

Indicates the beginning of the main function.

指示主要功能的开始

 

/*_some_comments_*/    

Whatever written inside this command “/*   */” inside a C program, it will not be considered for compilation and execution.

无论在C程序中将此命令写在“ / * * /”命令中的内容如何,都不会考虑对其进行编译和执行。

 

printf("Hello_World!"); 

This command prints the output on the screen.

此命令在屏幕上打印输出。

 

getch();    

This command is used for any character input from keyboard.

该命令用于从键盘输入的任何字符。

 

return 0;   

This command is used to terminate a C program (main function) and it returns 0.

该命令用于终止C程序(主函数),并返回0。

 

}    

It is used to indicate the end of the main function.

用于指示主要功能的结束。

关注
打赏
1665938897
查看更多评论
立即登录/注册

微信扫码登录

0.0390s