Today is too late, I finished brushing my teeth, directly paste the notes over it, hurriedly sleep.
- There are constants or references inside C + + classes
If there is a reference inside the member variable, it must be assigned at initialization time and can be assigned again after initializationIf there is a constant, you must also assign a value at initialization, and you cannot assign it after initialization.but we can point to this constant with a pointer, strongly to the variable, and then assign the value,the constants inside the class are also read in the way that memory is read
- Static member functions for C + +
static member functions belong to classes and can be directly class names:: Fun, Access
- C + + default parameters, padding from left to right
- C + + friend function, friend class
Const objects cannot refer to non-const member functions
- About level two pointers and references
If you want to change a pointer in a function, you can use a level two pointer, or you can use a reference to a first-level pointerint *p = #
void (int * * p1)//We pass in &p{*p = other;}orvoid (int * &p2)//We pass in P{pt = Other;}
- The difference between Malloc,free and New,delete
new and delete automatically call constructs and destructors, and malloc and free do not call constructs and destructors only allocate memory
2015-02-24