Home > Backend Development > C#.Net Tutorial > What is the only function in C language?

What is the only function in C language?

王林
Release: 2020-07-07 11:13:11
Original
4727 people have browsed it

The only function in C language is the main function. A complete C program has only one main function (main function). The main function can call various other functions, but other functions cannot call the main function. The C program starts execution from the main function and ends the entire program in the main function. of operation.

What is the only function in C language?

#The only function in C language is the main function.

(Recommended learning: C language tutorial)

Analysis:

A complete C program has and only one main function (main() function), the main function can call various other functions, but other functions cannot call the main function. The C program starts execution from the main function and ends the entire program in the main function.

Related introduction:

Main main function form:

1. The return value is int and the parameter is void:

int main(void)
Copy after login

This is a common one Writing method. The formal parameter is void, which means that no parameters can be passed in when it is called, so it cannot obtain command line parameters.

2. The return value is int, with two input parameters:

int main(int argc,char *argv[])
Copy after login

This is also the most common way of writing. The first input parameter is the number of command line parameters, and the second input parameter is the command line parameter array. Usually used to implement functions that require obtaining parameters from the command line.

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template