Archived

This topic is now archived and is closed to further replies.

TheOne1

header files and cpp files

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites