I am new to C++ and actually doing it as part of my Bsc degree, However the prescribed book 'c++ program design' is very hard to follow and frustrating. I am battleing with understanding Classes in particular declaring the class files. Although this site goes a long way to clarify the subject - my question is does anyone know of a site that may go a little deeper into the subject of classes etc?
Ok, here's a quick lesson on classes. This is a class.
Please ask me any questions you may have...I'm still a newbie myself, but yea...I wanna help =) My AIM name is RevolutionST.
class iwork //start out defining a class like this iwork can be substuted with any other name
public: //basically...for now...just put your functions in public, it's good practice
iwork(); //don't really worry about this, just do it
//functions going to be used in the class
void test1(); //gathers the number
void test2(); //outputs the contents of number gathered in test1();
//variables going to be used ONLY in this class...this is important when you get into inheritance.
};//<-------note the semicolon
//just makes the constructor happy
cout<<"Enter a number." <<endl;
cout<<"The number entered is: " <<number <<endl;
iwork inst; //creates an instance of the class so you can use it.
Edit1: ......I'm on my way home from work, I'll elaborate when I get home.
Edit2: I'm home now.