class Foo {
const int x;
protected:
Foo(int f);
~Foo();
};
Foo f;
Referring to the sample code above, why will the class
declaration not compile?
a) The variable x is const.
b) The destructor is protected.
c) The destructor is not public.
d) The constructor is protected.
e) There is no default constructor.

Answers were Sorted based on User's Feedback



class Foo { const int x; protected: Foo(int f); ~Foo(); }; Foo f; Referri..

Answer / guest

There is no default Constructor

Is This Answer Correct ?    11 Yes 3 No

class Foo { const int x; protected: Foo(int f); ~Foo(); }; Foo f; Referri..

Answer / alphare

a, d, e

Is This Answer Correct ?    2 Yes 1 No

class Foo { const int x; protected: Foo(int f); ~Foo(); }; Foo f; Referri..

Answer / guest

a

Is This Answer Correct ?    2 Yes 4 No

class Foo { const int x; protected: Foo(int f); ~Foo(); }; Foo f; Referri..

Answer / gopinath das

a,b,c,d

Is This Answer Correct ?    1 Yes 4 No

class Foo { const int x; protected: Foo(int f); ~Foo(); }; Foo f; Referri..

Answer / sampurna pandey

a,b,c,e

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More C++ General Interview Questions

if i want cin 12345678910 and cout abcdefghij. so how can i create the program?. example : if i key in 8910 so the answer is ghij.

3 Answers  


Are strings mutable in c++?

0 Answers  


What kind of jobs can I get with c++?

0 Answers  


What is the purpose of ios::basefield in the following statement?

0 Answers  


Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;

0 Answers  






Search for: what is pair in c++?

0 Answers  


Explain the ISA and HASA class relationships. How would you implement each in a class design?

3 Answers  


What is the full form of ios?

0 Answers  


What is an opaque pointer?

1 Answers  


How is computer programming useful in real life?

0 Answers  


What is a constructor initializer list and when we use constructor initializer list?

3 Answers   Soft Info, TCS,


What is decltype c++?

0 Answers  


Categories