+ 1
How to come output 3 ?
#include <iostream> using namespace std; class A{ public: static int a; A() {a++;} }; int A::a=1; void f(void){ A a; throw string("?"); } int main() { A a; try{f();} catch(string &s){} cout<<A::a; return 0; }
2 odpowiedzi
+ 1
Gordie thanks :)