Thread: programming style

  1. #1
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572

    programming style

    hello all...I'm in the process of making a program for homework that will include multiple classes. I was wondering what is a good convention for writing the classes. Would it be better to either have all the classes in a single .h file, and then have a seperate .cpp implementation file for each class. Or to have a different .h file for each class...
    how is it done in the industry? what is most practical,

    thanks, axon

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  2. #2
    Registered User glUser3f's Avatar
    Join Date
    Aug 2003
    Posts
    345
    the way I do it, is using a separate .h file for each class.

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    465
    ive always been told to put the class in its own header and define all of the non-inline functions in a .cpp with the same name as the header.

    or you put the whole class in the header if its a class template.
    I came up with a cool phrase to put down here, but i forgot it...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  2. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  3. Which style of if loops is most common?
    By dwks in forum A Brief History of Cprogramming.com
    Replies: 38
    Last Post: 08-25-2005, 03:18 PM
  4. WS_EX_COMPOSITED style (double buffering) problems
    By JasonD in forum Windows Programming
    Replies: 2
    Last Post: 10-12-2004, 11:21 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM