Home > Back-end > New one, ask your bosses, compiled in vs2019, run time are obtained.
New one, ask your bosses, compiled in vs2019, run time are obtained.
Time:10-03
# include using namespace std; Class A { Public: A (int n=10) {cout<& lt;" The default structure "& lt; /* if commented out here below a copy of the function, to run the program when he would call the destructor twice, just call a default constructor, the operation is in vs2019, put a breakpoint at he gave up his own destructor twice, the following comments the result to invoke a constructor, a destructor function called, I put this on the web page for the online compiler to run, no matter note not comment below a copy of the function result is called a constructor a destructor, to this confused, I don't understand what meaning is that the add function travels, according to the teacher the inscribed, writing is not very full, with some parameters, */ A (const A& A) {cout<& lt;" Copy "& lt; ~ (A) {cout<& lt;" The destructor "& lt; };
Void the add (A) A {}
Int main () { Add (A (10)); return 0; }
CodePudding user response:
Should be arguments and parameters are calling the destructor, and copy is quite so to construct A reference, the add function is an empty function, only defines an object parameter A