Thread: Creating a Dev-C++ Project File

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    34

    Exclamation Creating a Dev-C++ Project File

    I broke up my program into an implementation file, a header file and a client source code file. I am using Dev-C++ and am having trouble getting the project file to link everthing and build the project.

    So I have, say a, class.h which contains the class definition, class.cpp which contains the implementation, and client.cpp which is the driver program.

    Which header files should I include in each of the three separate files. Also, should I be including things like <string> and <iostream> in class.h, class.cpp and client.cpp? And should I also include the 'using namespace std' in all three?

    Thanks.

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    835
    You should include whichever standard header files you need in any of the .h or .cpp files, but never use a using directive in a header file, since it takes effect automatically in any file unfortunate enough to include it. Same goes for using declarations.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Creating File Handling Functions
    By td4nos in forum C Programming
    Replies: 6
    Last Post: 06-26-2009, 11:43 AM
  2. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 04:27 PM
  3. File transfer- the file sometimes not full transferred
    By shu_fei86 in forum C# Programming
    Replies: 13
    Last Post: 03-13-2009, 12:44 PM
  4. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  5. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM