Basically I'm pretty new to C++, I'm trying to implement the getting and setter function within a class data member using a struct, I got no idea where to start. I've looked around the internet but there's nothing that I can see. Here is the code: (Can you keep any explanations extremely simple)
class CPayRoll
{
private:
SEmployee* mp;
public:
CPayRoll( string name, int id );
~CPayRoll();
void SetDetails( string name, int id );
void GetDetails( string& name, int& id );
};
CPayRoll::CPayRoll( string name, int id )
{
mp = new SEmployee;
mp->name = name;
mp->id = id;
}
CPayRoll::~CPayRoll()
{
delete (mp);
}
void SetDetails( string name, int id )
{
}
void GetDetails( string& name, int& id )
{
}
int main()
{
CPayRoll* Olly = new CPayRoll("Olly",100);
Bookmarks