void main (void){ int a,b; a=b=0;}"."/> void main (void){ int a,b; a=b=0;}".">

Home  >  Article  >  Backend Development  >  What is the basic structure of a C language program?

What is the basic structure of a C language program?

藏色散人
藏色散人Original
2020-04-17 09:38:198346browse

What is the basic structure of a C language program?

#What is the basic structure of a C language program?

The basic structure of c language program:

#include<stdio.h>
void main (void)//这个就是主函数,第一个void 就是返回类型:有void,int ,float等可以选择,
//第二个是main就是函数名,这里是主函数,它名字固定的,其他的函数可以随
//意定义,第三个是void,是就是参数类型,一样可以由void,int,float等等选择。
{                              //中括号内就是函数体了,是函数的具体内容了
int a,b;
a=b=0;
}

C language is a general computer programming language and is widely used. The design goal of the C language is to provide a programming language that can be easily compiled, handle low-level memory, generate a small amount of machine code, and can run without any runtime environment support.

Although C language provides many low-level processing functions, it still maintains good cross-platform characteristics. C language programs written in a standard specification can be compiled on many computer platforms, and even include some embedded processors (single-chip microcomputer or MCU) and supercomputers and other operating platforms.

Recommended: "c Language Tutorial"

Unique Features

C language is a structured programming with variable scope ) and a procedural language with recursive functionality.

C language passes parameters by value (pass by value), and a pointer (a pointer passed by value) can also be passed.

Different variable types can be combined using structures (struct).

There are only 32 reserved keywords, which makes naming variables and functions more flexible.

Some variable types can be converted, such as integer and character variables.

Through pointers, C language can easily perform low-level control of memory.

Preprocessor makes C language compilation more flexible.

The above is the detailed content of What is the basic structure of a C language program?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Why learn C languageNext article:Why learn C language