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

Explain the purpose of the keyword volatile.

0 Answers  


When can I use a forward declaration?

0 Answers  


What are arrays c++?

0 Answers  


Write a program to find the Factorial of a number

0 Answers  


Is it possible to have a recursive inline function in c++?

0 Answers  






Explain linked list using c++ with an example?

0 Answers  


Write is a binary search tree? Write an algo and tell complexity?

0 Answers   Axtria,


Will a catch statement catch a derived exception if it is looking for the base class?

0 Answers  


Define friend function.

0 Answers  


Why main function is special in c++?

0 Answers  


Which function should be used to free the memory allocated by calloc()?

0 Answers  


Explain the term memory alignment?

0 Answers  


Categories