mark wrote:
> what should be placed inside these files?
>
> i had written some code and saved it it in .h and written no more extra .cpp 
> class except for main cpp file(counter to what a book said "write definitions 
> to a .cpp file")
>
> am i breaking any rules here?
>   

There are no rules, just best practices and coding conventions.

You put interfaces in headers, implementations in cpp files. In other 
words, your class and function definitions go in the header, but the 
actual code, the meat of them, goes in the cpp file.

This allows you to reference code across compilation units because you 
can "compile" the headers multiple times, but you must only have one 
implementation come link time.

-- 
John Gaughan
http://www.jtgprogramming.org/

Reply via email to