class CRectangle {
int x, y;
public:
void set_values (int a,int b);
};
This is an example of a class definition, that you can define in a header file. Do notice that we currently have no implentation of set_values. So therefore we make a .cpp file and put this in there:
1 2 3 4 5 6
#include "HeaderfileName.h"
void CRectangle::set_values (int a, int b) {
x = a;
y = b;
}
The reason for doing this is that your code gets a lot more organized, especially when you have hundreds or thousands of lines of code.