Thread: Inheritance file placement

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    117

    Inheritance file placement

    If I had a Building project...and a Building was made up of ADTs such as Rooms, Hallways, etc. Where would I put these different files? Would I just make a Building project and have all these different files in the same source and header folder? Or do people make new projects for each ADT? And if I had a Bathroom object that was a subclass of Room, do you just place Bathroom files in the same folder as Room files? I know everyone might have their own way of doing it but I figure there must be a general way of handling it when people create large projects. Or could someone refer to a website or anything that could help me out?

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    A good rule of thumb is to put each class in its own header and source file. All those files that belong to the same project would go in the same folder.

    Since all your ADTs are related to Buildings, I think it makes sense to have one Building project and put all the header and source files in the same folder and add all the files to that project. It doesn't sound like your program is big enough for multiple projects or multiple folders yet.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  2. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM
  3. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM
  4. Hmm....help me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 10:57 AM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM