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.

Answer Posted / guest

a

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what happens when a pointer is deleted twice?

884


What is difference between n and endl in c++?

664


Explain deep copy and a shallow copy?

694


Which is best c++ or java?

740


What is prototype for that c string function?

774






How to allocate memory dynamically for a reference?

623


What programming language should I learn first?

693


How to declare a pointer to an array of integers?

730


What is the use of 'this' pointer?

888


What is the difference between *p++ and (*p)++ ?

860


What is the best book for c++ beginners?

668


What problems might the following macro bring to the application?

706


Why isn't sizeof for a struct equal to the sum of sizeof of each member?

625


what is VOID?

709


What is name hiding in c++?

737