Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C Language Problem -—max () Function
C Language Problem -—max () Function
Max () is not a function provided by C language, but is defined by the programmer himself.

It is the source code of the program you see. The person who wrote the program defined a function called max. It is different from the main () function. Main () is defined in the C language function library, and main () has been given meaning, that is, the main function of every C program. And this max () is only defined by the person who writes the source code.

Just like when you write a program, you can define variables at will, such as int a;; ; Just define a plastic variable named a, which can also be defined as int b;; ; I just changed my name. The meaning has not changed. This max (), you can completely rename it as num (), sum () and other functions, and you can rename it at will.

Int max(int a, int y) means:

The first int is used to define max () as an integer function, and max is the name of this function. Int a and int y in brackets are parameters of max function, which means, for example, a function f in your mathematics, and its expression is: y=3x. I wrote this expression casually, so its function name is F, and its parameters are Y and X. Of course, the functions in mathematics and programs are completely different in nature. Int a and int y define parameter a as shaping and parameter y as shaping.

Landlord, do you understand?