There are no classes in C++.
All C++ has are structs.
The C++ "class" is implemented as a struct.
This:
- struct MyStuff
-
{
-
private:
-
int data;
-
public:
-
void SetData(int);
-
int GetData();
-
///etc...
-
};
is exactly the same as:
- class MyStuff
-
{
-
private:
-
int data;
-
public:
-
void SetData(int);
-
int GetData();
-
///etc...
-
};
That is, as long as you specify our member access as public/private/protected, there is no difference between a struct and a class.
There is one difference when you do not specify the member access. The default access for a struct will be public whereas the default access for a class will be private.
I suggest you expand your research into how to implement encapsulation.