Sempre inicialize todos os campos em um construtor.
struct
CC
{
int n;
char
c;
};
class Point{
public:
Point(int
newx, int newy);
private:
intx;
int
y;
CC
myStructure;
};
Point::Point(int newx, int newy) : x(newx), y(newy) {
myStructure.n = 1;
myStructure.c = 'a';
}
|
|