header files and cpp files
What kind of things should go in header files? I know that when working with classes/structs, it is a good programming practice to separate class interface from implementation, but what about regular functions? Should non-member functions (class functions) be in a header or source file?
thanks in advance for replies.
Generally, in my opinion, definitions should go in header files, and implementation should go in cpp files. My header files would often have a prototype for the non-member functions and the implementation in a cpp file.
Hope this helps
Hope this helps
quote:Original post by ForeverStarlight
Generally, in my opinion, definitions should go in header files, and implementation should go in cpp files. My header files would often have a prototype for the non-member functions and the implementation in a cpp file.
Hope this helps
Yes, everything like that should be put in headers. As well as enums, defines and externals.
VG-Force | Ekim Gram Productions
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement