What are the four functions that compiler automatically provides? How can you prevent compiler to provide automatically?
Latest Answer: default constructorcopy contructor assignment operatordestructor ...
Compare Modular Structered Programming and Object Oriented Programming
Latest Answer: In Modular programming everything is broken down into modules performing a constituent task. Object Oriented programming revolves around a real world object. A Car Object is different from a driver Object yet both of them communicate using messages (or ...
Which of the following is an illegal cast based on this code snippet? struct B{ operator int();};struct D: B{};B b;float const f = 0;A. static_cast(&b);B. static_cast(b);C. static_cast(b);D. static_cast(&f);E.
Latest Answer: In order to cast we need something like thisstatic_cast(nValue); ...
What is the problem or error with the following code snippet and how would it be fixed?class Car { public: Car() { num = 1; } private: const int num;};A. You cannot change a const
Latest Answer: Use initialization list to initialize a const data member.Car() : num(1) { } should fix the problem. ...
class ABC { public: ABC(int i = 0) { val = i;} int GetVal() {return val;} void SetVal(int i) {val = i;} private: int val;};void DoubleABC(ABC&
Latest Answer: answer A ...
Which of the following function name is legal in C++?A. $_foo()B. !_foo()C. 1_foo()D. -_foo()E. #_foo()
Latest Answer: A is the only one that will work.The reason are :!, - are operators, # is the preprocessor operator. #define, #pragma, also use #9 -> stringify value to char.1 - numeric value (can be used at end of function / method)$ ...
To allow derived class functions to access private base class data, what should you do?A. You should use a private base class function.B. You should use a public or protected base class function.C. You
Latest Answer: E. but making the base class data protected is a good solution. ...
class ABC { public: ABC(int i = 0) { val = i;} int GetVal() {return val;} void SetVal(int i) {val = i;} private: int val;}void DoubleABC(ABC&
Latest Answer: Answer is A.There is no problem with the code. ...
Which one of the following statements is FALSE?A. The access privileges in C++ are private, protected and public.B. The default access level assigned to members of a class is private.C. Public members
Latest Answer: C. Public members of a class can be accessed by everyoneTrue.Look here class CTest {public: int m_n; };class COther {public: COther(CTest &obj) { obj.m_n = 1; //also okay ...
Hi I very recently did the C++ online Quiz and was surprised to find that my answer (1) to the following question (below) was incorrect. Is there something I am missing here, or is the answer incorrect.
Latest Answer: gpuchtel's answer makes sense to me. The fact that size of the derived class object is sum of size of all the public and private members of base class and derived class corroborates the argument. ...
View page [1] 2 3 4 5 6 7 8 9 10 Next >>

Go Top