Home > Back-end >  Ask questions about the C header file
Ask questions about the C header file

Time:10-03

In general in the header file statement, defined in the CPP, actually understand feeling a little doubt. Usually the class statement. H file, inline function can be defined in a header file.
The constructor should put the header file?
The landlord to see a lot of code is put the constructor in the header file (apparently also row in the CPP).
The copy constructor copies the assignment operator (operator=) should be placed in a header file?
The destructor?
Move the constructor or the assignment operator?
Virtual destructors or something?
Inherited constructor or something?
See a lot of code is put above in the header files, to make a little ocd, wanted very much to know.
(recently in the c + + primer, a bit of a problem, consult)


CodePudding user response:

And.h files. C file is essentially the same, compile to deliberately go to distinguish, if the code written where are all the same,

CodePudding user response:

Constructor and destructor inline is not recommended, non-inline function on the CPP file
  • Related