So I want to ask what is the meaning of bosses function
Best plain
CodePudding user response:
What is function in mathematics?Y=f (x), for each x has a corresponding to it, y is called function f of x, y
Similarly, the y is regarded as the return value, x as parameters, for each parameter, there is a return value corresponding to it, so the return value relationship with parameter is called the function, namely a set of instructions, this set of instructions to some processing parameters, and then get a return value, this set of instructions is called a function,
CodePudding user response:
The earliest programmers call IDA, puts forward the concept of programFirst suggested the loop branch is also a female programmer
At that time, the implementation is to use a bunch of goto implementation
Then there is the concept of subroutine, this is the function of the predecessor,
Is to goto the subroutine, goto back
Then, the concept of structured programming, borrow the concept of function in mathematics,
Computer chunk of code, it is in processing data, the open separation processing statements
Passed to a function to deal with the parameter, return to the calculation results, like function
You will find that the vast majority of the library function has no global variables, each function is independent of the
Function also try not to change the parameters of the incoming
In this way, the functions of the users and authors, will be able to work independently,
Function of the user, you don't have to understand the function of the implementation details, you can add different function, to your own code in
Later, further abstraction and object-oriented programming concepts,
That is to say, all the code in the main, it is not good style,
But should put the abstract the layers and layers of processing steps
The parameters used in each layer, layer should be its parent, defined,
Different family should not be Shared global variables,
This is object-oriented programming concepts, he further encapsulate relevant parameters and functions together,
Up is the development model, for beginners is very abstract, concrete to join project to well understand,
For C, the concept of function is the most important, because C preference for the underlying, often structured programming method with some better,
CodePudding user response:
Learned, know what is the functionCodePudding user response:
You can regard it as a formula, and use it every time you put the data in a result, only the results in most cases is a series of operations, not just a dataCodePudding user response:
The first day of learning c codeInt main () {
Printf (" Hello, World!" ); This is called function
return 0;
};
With the two functions, the program of the main function int main (); And output function printf ();
Reading just order, studied the content of the front, after turn the book into your book "c language program design", there must be a separate function inside a chapter
To tell others, but also the content of the repeat the book
First to understand, and specific questions to ask.
And you learn English, did not begin to tell you grammar, always letters first and then learn the sentence
Function also is same, use first, and then deeply understand to
Are not in a few words can say understand