Traditional Culture Encyclopedia - Traditional festivals - C language function definition and function declaration difference
C language function definition and function declaration difference
The poster can think of it this way, in C language, whether it is constants, variables, or functions, they can only be used if they are defined first.
When defining a function, your brain should be directed in the direction of general constants and variable definitions, and do not think about other things about the function first.
After defining it, put the definition of the function aside and ignore it.
Next is the function declaration. As we all know, C language consists of a main function main() and 0 or n ordinary functions.
Since the longer the code, the more functions are used. In order to reduce the confusion of functions, there must be a function name, just like the teacher calling the name. Declaring a function is like calling the name of a student.
In short, function definition is required by the system. If it is not defined, it will be an error. In fact, it is okay not to define the function declaration, but for convenience and reducing errors, it is artificially required to be declared.
- Previous article:Red is not unique to China. Why is it called "China Red"?
- Next article:What are the women of the times in Mao Dun's novels?
- Related articles
- How to start learning landscape painting
- Xi 'an Vocational and Technical College ranks in the top ten schools.
- The precautions of armpit odor surgery
- How to draw the fourth level of English mind map
- How to play the game of dice?
- Benefits and disadvantages of braces (are there any benefits to wearing braces)
- What are the three musts?
- Munich traditional dress
- Categorizing Users 1 - Market Segmentation
- What is a Yao bath?