Original Post
In C++, is a constructor for a class simply there to set a "default value"? For example: So this basically makes a class CRect, and sets the values of x and y to 5 and 15 respectively. So if you did not modify those values somehow within the class, they would remain 5 and 15. Right? Is this the point of constructors...declaring a default value for protected integers, etc. within a class? Or am I off here? Also, what are destructors used for? Sorry for these dumb questions, I'm just a bit confused and am still rather new to C++.
class CRect()
{
int x, y;
public:
CRect(int x, int y); // constructor?
};
CRect::CRect
{
x = 5;
y = 15;
}