[Edit]
Oops sorry about the typos Fixed them I suck at typing.
[/Edit]
You have a class definition
Code:
TestClass1.h //
class TestClass1
{
private:
int private_var;
protected:
int protected_var;
public:
int public_var;
//to make a function or another class or a another classmember function a friend simply
//use the friend keyword
friend int anotherfunction();
friend Class2;
friend Class3::class3memberfunction();
int test1_member_Function(); //memberfunction you can also make functions private or protected just list them under the appropriate section
TestClass1(); //constructor
~TestClass1(); //destructor
};
now for the definition of the class member functions
Code:
TestClass1.cpp
#include "TestClass1.h"
TestClass1::TestClass1() //definition for constructor
{
}
TestClass1::~TestClass1() //defintion for destructor
{
}
int TestClass1::test1_member_Function() //definition of test member fucntion
{
return private_var; //change this to the others to see what happens
}
This is a single class if you want to create a second class just duplicate this code but Replace the TestClass1 classname with whatever other name TestClass2 perhaps. One final note include both headers of the classes in your main.cpp