CPP-2 online test, online practice test, exam, quiz

Ask a question
          

CPP-2 online test, online practice test, exam, quiz

www.careerride.com


1. What is the output of the following code snippet?

class test {
public:
static int n;
test () { n++; };
~test () { n--; };
};

int test::n=0;
int main () {
test a;
test b[5];
test * c = new test;
cout << a.n << endl;
delete c;
cout << test::n << endl;
return 0;
}






 
       Discuss this question

Total 24 questions Time spent 0:0

Home | Login | About us | Sitemap | Contact us