class

This is a discussion on class within the C++ Programming forums, part of the General Programming Boards category; when writing a class, do i need create a header file, a implementation file and the test file to test ...

  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    4

    class

    when writing a class, do i need create a header file, a implementation file and the test file to test the class. If so, do i need to create these file sperately?

    thank you for your help

  2. #2
    Programming Sex-God Polymorphic OOP's Avatar
    Join Date
    Nov 2002
    Posts
    1,078

    Re: class

    Originally posted by henry
    when writing a class, do i need create a header file, a implementation file and the test file to test the class.
    No, you don't HAVE to, but it's good practice to put the class definition in a header file and the implementation in a source file.

    Originally posted by henry
    do i need to create these file sperately?
    Not quite sure what you're asking here. You can make the files whenever you want, as long as you #include the file with the definition (considering you choose to put the class definition in a header file).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Class design problem
    By h3ro in forum C++ Programming
    Replies: 10
    Last Post: 12-19-2008, 09:10 AM
  2. Two conceptual questions
    By AntiScience in forum C++ Programming
    Replies: 3
    Last Post: 11-01-2007, 12:36 PM
  3. Defining derivated class problem
    By mikahell in forum C++ Programming
    Replies: 9
    Last Post: 08-22-2007, 03:46 PM
  4. matrix class
    By shuo in forum C++ Programming
    Replies: 2
    Last Post: 07-13-2007, 02:03 AM
  5. Abstract class problem
    By VanJay011379 in forum C++ Programming
    Replies: 9
    Last Post: 07-31-2002, 02:30 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21