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 / sampurna pandey

a,b,c,e

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell me difference between constant pointer and pointer to a constant.

746


How are the features of c++ different from c?

692


We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?

694


Why do we use using namespace std in c++?

711


In the derived class, which data member of the base class are visible?

740






What is the advantage of c++ over c?

652


Mention the purpose of istream class?

705


What is a class definition?

704


why is c++ called oops? Explain

668


What is the difference between struct and class?

878


What is a far pointer? where we use it?

704


What is a dynamic binding in c++?

606


What are virtual constructors/destructors?

648


What is meant by const_cast?

763


How can you link a c++ program to c functions?

723