Thread: class

  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, 11:36 AM
  3. Defining derivated class problem
    By mikahell in forum C++ Programming
    Replies: 9
    Last Post: 08-22-2007, 02:46 PM
  4. matrix class
    By shuo in forum C++ Programming
    Replies: 2
    Last Post: 07-13-2007, 01:03 AM