Hi g++ experts,

First of all, happy new year and the best wishes for 2007!
I get a warning in g++ when I use a struct which I don't initialize in
the member initialization, but in the constructor itself.
To correct this I want to perform member
initialization, but I have no idea how to do this correctly.
Some example code (from the top of my head):

typedef struct MyDate
{
unsigned short year;

unsigned short month;
unsigned short day;
} MyDate;


class
{
public:
        MyTest();
private:
        MyDate date;
}

void MyTest::MyTest() :
  date.year(0) -> this doesn't work. What syntax should i use?
{
  /*  This works, but generates the warning because date is not
initialized in the member initialization
        date.year = 0;
        date.month = 0;
        date.day = 0;
  */
}

I hope someone can help.

_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to