Thread: Classes and header files

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    118

    Classes and header files

    I was given a c++ project to write an i an coming from a c and java background.I am more proficient in java.I am confused in creating classes in c++ because it creates a header file for me with the class name and in my.cpp file,it just's gives me a constructor.I am confused.My question is shouldn't the class name be in my .cpp file

  2. #2
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    Your question is kind of confusing. Maybe you should post some code.
    The cost of software maintenance increases with the square of the programmer's creativity. - Robert D. Bliss

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    Quote Originally Posted by sigur47 View Post
    shouldn't the class name be in my .cpp file
    Probably, or maybe not.

    If you're running into a problem with the code or are not sure if you're going about it the right way, then you'll need to post code on here so that we can check it out.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Header files and classes
    By disruptivetech in forum C++ Programming
    Replies: 5
    Last Post: 04-21-2008, 09:02 AM
  2. classes and header files
    By Drake in forum C++ Programming
    Replies: 8
    Last Post: 11-30-2006, 07:12 PM
  3. Header Files and Classes.
    By Lithorien in forum C++ Programming
    Replies: 10
    Last Post: 08-13-2004, 12:10 PM
  4. Classes and header files
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 08-23-2002, 10:42 AM
  5. doin' classes in header files?
    By face_master in forum C++ Programming
    Replies: 9
    Last Post: 11-14-2001, 03:56 AM