Lets say that we have two compilation units as follows:
// a.cpp
extern int value2;
int value1 = value2 + 10;
// b.cpp
extern int value1;
int value2 = value1 + 10;
When I tried it on VC2010, it initializes value1
and value2
to zero first. aren't both value1
and value2
dynamically initialized and default initialization doesn't apply on them?
Thanks,