Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Go over class

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello,
I just came out of hibernation and im going into my 3rd year of C++. I forgot how to set up a class. Here is what Ive got, is this right so far?

class hello
{
private:
hello(); //contructor?

public:
int funct A(); //prototypes?
int funct B();
};

how do I setup the implemtation for funt A and B?
 
You're Close. However you don't want your constructor to be private. I'm not even sure if it will work if you explicitly make it private.

As for the implementation of your functions, they should look something like this:

int hello::functA()
{
//body of function
}

Same with B.

For a quick review of Classes, if you happen to have Visual C++ laying around, make a dummy project, then use the "add class" option - it'll set up a skeleton class for you to take a look at.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top