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

Is c++ an integer?

0 Answers  


Briefly describe a B+ tree. What is bulk loading in it?

0 Answers   Wipro,


Are vectors passed by reference c++?

0 Answers  


What is the difference between multiple and multilevel inheritance in c++?

0 Answers  


What are the various arithmetic operators in c++?

0 Answers  






Can you Mention some Application of C/C++?

0 Answers  


Write about c++ storage classes?

0 Answers  


how to create window program in c++.please explain.

1 Answers   Microsoft,


How is c++ different from java?

0 Answers  


how to access grid view row?

0 Answers  


What do you mean by inheritance in c++? Explain its types.

0 Answers  


What is difference between initialization and assignment?

12 Answers   HCL, HP, Infosys,


Categories