-
Empty Class Size
What is the size of an empty class?
-
Matrix Operation using Operator Overloading
Write a program for four atrithmetic operations in matrix using operator overloading.
Nested Classes
Do Nested Clases exists? If so, where are they used?
Virtual Constructor
Why constructor cannot be virtual in C++?
C++ Type Conversion
Why does 'float' accept 'int' but not 'char'?
Classes
The copy constructor of class Money is called in which of the following cases?Choose one answer. a. Money amount1;Money amount2(amount 1); b. void func(Money amount);[...]Money amount1;[...]func(amount1); c. Money func();[...]Money amount1 = func(); d. all of the above
Memory Allocation
When is memory allocated for a function of a class? Is it when the program is complied, or only when the function is called?
What is the Size of an Empty Class
What is the logic behind size of an empty class = 1? (As per C++)Ex:class base {};main(){printf("Size of the Empty Class is: %dn", sizeof(base));}It gives output: Size of the Empty Class is: 1I have not got the reason / logic behind this.Can anyone help me?
Constructor initialization lists
What is advantage of using Constructor initialization lists?
Solve this using C++ code
Write a solution in any language to the following: Given a large list of integers (more than 1 000 000 values) find how many ways there are of selecting two of them that add up to 0
What are virtual functions?
A virtual function allows derived classes to replace the implementation provided by the base class. The compiler makes sure the replacement is always called whenever the object in question is actually of the derived class, even if the object is accessed by a base pointer rather than a derived pointer. This allows algorithms in the base class to be replaced in the derived class, even if users don't...
Ans