M
Massimiliano Alberti
Now, in C++ you can do:
struct X
{
int ia;
int ib;
};
class CL
{
public:
X x1;
int a, b;
// you can do this
CL() : a(0), b(0)
{
}
// and you can do this
void DoSomething()
{
X xx = {0}; // it's equivalent to a memset(&xx, 0, sizeof(X));
}
};
Now... How can I zero x1 in the CL constructor?
And... Why the X xx = {0} works? It seems a strange syntax...
--- bye
struct X
{
int ia;
int ib;
};
class CL
{
public:
X x1;
int a, b;
// you can do this
CL() : a(0), b(0)
{
}
// and you can do this
void DoSomething()
{
X xx = {0}; // it's equivalent to a memset(&xx, 0, sizeof(X));
}
};
Now... How can I zero x1 in the CL constructor?
And... Why the X xx = {0} works? It seems a strange syntax...
--- bye