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
Will the following program execute?
What is abstraction c++?
How many ways can a variable be initialized into in C++?
What is the basic structure of c++ program?
When a function is made inline. Write the situation where inline functions may not work.
write a program in c++ to generate imp z y x w v w x y z z y x w x y z z y x y z z y z z
What is a stack c++?
What is public, protected, private in c++?
What is the use of seekg in c++?
To which numbering system can the binary number 1101100100111100 be easily converted to?
What are punctuators in c++?
In a class, there is a reference or pointer of an object of another class embedded, and the memory is either allocated or assigned to the new object created for this class. In the constructor, parameters are passed to initialize the data members and the embedded object reference to get inialized. What measures or design change should be advised for proper destruction and avioding memory leaks, getting pointers dangling for the embedded object memory allocation? Please suggest.