Home  >  Article  >  Backend Development  >  What is the only function in C language?

What is the only function in C language?

王林
王林Original
2020-07-03 14:03:083594browse

The only function in C language is the main function, which is called the main function. In C language, the program always starts execution from the main function, and always ends at the return statement or the end of the main function by default.

What is the only function in C language?

The only function in C language is the main function, which is the entry and exit of the program.

(Recommended learning: C language tutorial)

Related introduction:

In C language, the program always starts from the main function Execution, and always ends at the return statement or the end of the main function by default.

The biggest feature of C programs is that all programs are assembled using functions. main() is called the main function and is the entry point for all program operations. The remaining functions are divided into parameterized and parameterless, and are called by the main() function or other general functions. If a parameterized function is called, the parameters are passed during the call.

Code example:

int main(void)//整数类型 主函数(无类型)
{
...
y1=f1(x1,x2);//赋值过程
...
}
 
f1(int a,int b)//f1(整数类型 a,整数类型 b)
{
Y2=f2(x3,x4);//赋值过程
}
f2(int m,int n)//f2(整数类型 m,整数类型 n)
{
}

The above is the detailed content of What is the only function in C language?. 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