Static initialization order
What is the output of this program?
#include <iostream>
class A { public: A(){std::cout<<"a";} ~A(){std::cout<<"A";} };
class B { public: B(){std::cout<<"b";} ~B(){std::cout<<"B";} };
class C { public: C(){std::cout<<"c";} ~C(){std::cout<<"C";} };
A a;
void foo() { static C c; }
int main() { B b; foo(); }
Sign in to answer questions and track your progress
Sign In