How to come output 3 ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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; }

1st Oct 2017, 6:10 PM
Anuj kumar
Anuj kumar - avatar
1 Answer
+ 1
Gordie thanks :)
1st Oct 2017, 7:13 PM
Anuj kumar
Anuj kumar - avatar