I am not very familiar with C++ , and while I am trying some test programms I came to a question regarding the best if I may say so way to define some primitive elements in C++ code.
Let's take a class that describes rectangles. It would create them, draw them , rotate, resize, etc... now in most cases we have to deal with points on the canvas. The rectangle its self is described by 2 points: Upper Left and Lower Right corner. Also in order to Rotate it, you need an angle, and a point(anchor point). Or maybe to move it you need a new anchor point for the given rectangle. I guess I made my point in using points . So what is more efficient ? to define this primitive point as a class or as a struct?
class cPoint
{
public:
int X;
int Y;
};
or
typedef struct
{
int X;
int Y;
}sPoint;