awfully urgent, plz help me

This is a discussion on awfully urgent, plz help me within the C++ Programming forums, part of the General Programming Boards category; I have to submit my assignment in an hour.I've written 3 classes with the names of Point, Line and Polygon. ...

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    35

    Exclamation awfully urgent, plz help me

    I have to submit my assignment in an hour.I've written 3 classes with the names of Point, Line and Polygon. in each class I have used a function with the return time of the 2 other classes' pointers. like, let's say:
    Code:
    class Point
    
    {
    
    Line * b(Point p)
    {
    }
    ;
    }
    now I have to separate them(each class) in cpp and header files. the only thing i'm sure of, in writing header files is that I should write #ifndef X_H and #define X_H at the beginning and#endif at the end.
    what else should I write in its header files andd cpp files?
    what should I include?
    where do I have to write the scope resolution operator?
    please note that in each class i'm using functions with return types of the 2 other classes.

  2. #2
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,406

    ?

    well you just need to move your class and function declarations into the header files, and then the class constructor and function definitions into respective source files, add them to project and then where a file depends on a certain element.. write the header include at the top of file
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

  3. #3
    Programming King Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Middle of NoWhere
    Posts
    320
    You should better refer to the book or read some of tutorials to make separate header files, their cpp's and main file.....
    I don't care if someone doesn't like me, i was not put on earth to entertain everyone.

    No King, no Queen, I am the ACE of battle.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. project .... help plz plz plz
    By Hitchhik3R in forum C Programming
    Replies: 13
    Last Post: 10-24-2010, 02:07 PM
  2. Need help with a turbo c program....urgent plz help
    By hassan_shohag in forum C Programming
    Replies: 10
    Last Post: 06-27-2010, 01:14 PM
  3. can any1 plz make this assignment
    By jean in forum C Programming
    Replies: 17
    Last Post: 05-13-2009, 09:19 PM
  4. display the contents of all the files
    By Tintu in forum C Programming
    Replies: 8
    Last Post: 10-08-2007, 12:17 AM
  5. Another urgent help, plz reply fast
    By playboy1620 in forum C Programming
    Replies: 4
    Last Post: 04-11-2002, 05:21 AM

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