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
Tell me difference between constant pointer and pointer to a constant.
How are the features of c++ different from c?
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?
Why do we use using namespace std in c++?
In the derived class, which data member of the base class are visible?
What is the advantage of c++ over c?
Mention the purpose of istream class?
What is a class definition?
why is c++ called oops? Explain
What is the difference between struct and class?
What is a far pointer? where we use it?
What is a dynamic binding in c++?
What are virtual constructors/destructors?
What is meant by const_cast?
How can you link a c++ program to c functions?