#include<iostream>#include<cmath>//C + + 's mathematical function libraryusing namespacestd; classpoint{ Public: Point&P);//There is no return type; The constructor function name must be equal to the class name; it is usually set as a common function. The constructor is automatically called when the object is created. voidInitintx=5,inty=6);//The function can pre-declare the default parameter value [with default parameters worth function] when defined; Note: There must be a default parameter at the end of the parameter, that is,//The parameter with no default value cannot appear to the right of the default worthy parameter. Because in a function call, the actual participation parameter is set to the corresponding relationship in the left-to-right order. intDothat (intXinty=9,intz=3); voidPrint ()Const; voidMoveintDxintdy); Private : intx; inty; intZ; /** Inline Function: * For some functions that are simple, small and frequently used, the function can be designed as an inline function; the inline function is not a control transfer at the time of invocation, but rather embeds the body of the function in each call at compile time. * This reduces the overhead of parameter transfer control transfer. * Note: * Inline is just a keyword, indicating a requirement that the compiler does not commit to inline-modified functions as inline functions. Functions that are not inline-modified in the modern compiler may also be compiled into inline functions; * Usually inline functions are relatively simple functions, with fewer statements; If you define a more complex function as an inline function, it will cause code bloat to increase overhead, in which case the compiler will automatically convert it to a normal function. *inline type specifier function name (formal parameter list with type description) {*//statement sequence; *} **/};voidPoint::init (intx=4,inty=2) {}point::P oint ( point&p) {x=p.x; X=p.y;}intMain () {point A; A.init (1,2); A.print (); A.move (2,2); A.point (); return 0;}/** Function part: * A C + + function can consist of the main function and several sub-functions, the main function is the starting point of the execution of the program, the main function calls the child function, the child function can call other sub-functions. * Functions called by other functions are called main functions, and functions called by other functions are called function calls. * Function Definition: * * type specifier function name (parameter table for function type description) {*//statement sequence; *} * Class definition: *class class Name {* Public: * External interface * Protected: * Protected member * Private: * Private Member *} * CLASS member function: * Return value type class Name:: function member name (parameter Tables) {* Function Body *} * * Function Overload: * More than two functions, with the same function name, but the number or type of formal parameters, the compiler automatically determines which function to invoke based on the type and number of arguments and parameters, which is the overload of the function 。 * Note: The compiler does not use the return value of the wire drawing to differentiate functions. Do not define functions with different functions as overloaded functions to avoid confusion about calls. When you use function overloading forms with default parameter values, you need to be aware of the ambiguity prevention. * *c++ system functions: * * **/
-----------Feiruo----------
, &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp , &NB Sp &NBSP;2015.07.21.23:39:31
My C + + notes (part of the function)