Hey guys, I somehow got into this problem but I don't know why. Say I have a simple code like this:
class A
{
public:
int a;
int b;
int c;
A() :
b(1),
a(1),
c(2)
{}
};
int main()
{
A a;
Using VS 2015 debugger, I put down a breakpoint on A a; and trace it down. Somehow it shows that 'a' is initialized first, then 'b'. I was thinking that 'b' should be initialized first then 'a'. My assumption is that this happens because the first declared property is 'int a' instead of 'int b', because when I switched them, it works by order (b, a, then c).
The big question to clear my assumptions is : why? :huh: