-
Static and friend function in a class
Use of static and friend function in a class
-
Will the program run successfully?
Main(){ int a=2.9; float b=9; cin>>"%d %f">>a>>b; return();}
-
-
Using Inheritance
Using inheritance, which of the following is not alloweda) Changing implementation of operation in parent by the subclassb) Using implementation of operation in parent class by the subclassc) Using attributes in parent class by the subclassd) Having operations is subclass which do not exist in parent classe) None
-
Do Nothing Constructor
What are Default Constructor and Do Nothing Constructor
-
Deallocation of memory
When we allocates the memory using malloc() and calloc(), it returns pointer pointing to the base address to the allocated memory. But while freeing the memory we call free(pointer) thenHow the operation system knows that how much memory is about to be free.
-
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 is a template?
Templates allow to create generic functions that admit any data type as parameters and return value without having to overload the function with all the possible data types. Until certain point they fulfill the functionality of a macro. Its prototype is any of the two following ones: template identifier> function_declaration; template identifier> function_declaration; The only difference between...
What is namespace?
Namespaces allow us to group a set of global classes, objects and/or functions under a name. To say it somehow, they serve to split the global scope in sub-scopes known as namespaces. The form to use namespaces is: namespace identifier { namespace-body }Where identifier is any valid identifier and namespace-body is the set of classes, objects and functions that are included...
Ans