C
Christopher
Embarrassed to ask, but is there any functional difference between
class A
{
int m_x;
int m_y;
public:
A()
:
m_x(0),
m_y(0)
{
}
~A(){}
Reset()
{
m_x = 0;
m_y = 0;
}
};
class B
{
int m_x;
int m_y;
public:
B()
:
m_x(0),
m_y(0)
{
}
~B(){}
Reset()
{
B();
}
};
Both seem to compile and work as expected, but as I've learned over
the years, just because it runs and shows you what you want to see,
doesn't mean it works.
class A
{
int m_x;
int m_y;
public:
A()
:
m_x(0),
m_y(0)
{
}
~A(){}
Reset()
{
m_x = 0;
m_y = 0;
}
};
class B
{
int m_x;
int m_y;
public:
B()
:
m_x(0),
m_y(0)
{
}
~B(){}
Reset()
{
B();
}
};
Both seem to compile and work as expected, but as I've learned over
the years, just because it runs and shows you what you want to see,
doesn't mean it works.