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 / alphare

a, d, e

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different types of comments allowed in c++?

581


Can we sort map in c++?

596


Do class declarations end with a semicolon? Do class method definitions?

622


What is the main function c++?

604


Can a class be static in c++?

573






What is a string example?

551


Comment on c++ standard exceptions?

639


What is input operator in c++?

591


How are pointers type-cast?

649


Explain the pure virtual functions?

643


What is enum class in c++?

710


What is the latest version on c++?

689


What can c++ be used for?

585


On throwing an exception by the animal constructor in p = new animalq, can memory leak occur?

683


Difference between delete and free.

619