header files and cpp files

Started by
3 comments, last by TheOne1 20 years ago
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.
----Me: So do you know any computer languages?Friend: Ummm....yeah, I used to know l337 talk.Me: ok....
Advertisement
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
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
okie, thank you!
----Me: So do you know any computer languages?Friend: Ummm....yeah, I used to know l337 talk.Me: ok....
Read this.

This topic is closed to new replies.

Advertisement