Chapter 4 Function Assignment questions, built-in functions, and Chapter 4 assignment questions
What are built-in functions? It is also an inline function.
A function embedded in the main function is called a built-in function, that is, although the function is written outside of main (), it is identified by the keyword inline, in this way, the function written outside can be written in the main function main.
What is the difference between writing a function out of the main function and writing it in the main function?
Can run normally, but the program efficiency is different. Writing in the main function has a high efficiency, because it is a waste of resources and time to keep the site outside for searching.
Example: 4.7
# Include <iostream> using namespace std; int max (int x, int y, int z); int main () {int a, B, c, m; cout <"Enter three integer numbers:" <endl; cin> a> B> c; m = max (a, B, c ); // The actual parameter, representing The specific value. In (), cout <"The max of a B and c is:" <m <endl; system ("pause"); return 0;} // inline function one keyword inline int max (int x, int y, int z) {if (z> x) x = z; if (y> x) x = y; return x ;}