-
Program Crash
When can it happen that before calling main function itself program gets crashed?
-
Memory Allocation
Why is it suggested not to use malloc() or calloc() in C++ for memory allocation?
-
Pointers Datatype
What is the datatype of pointer?
-
Operators
In the following code fragment, which is the calling object for the less-than operator?string s1, s2;if( s1 < s2 )Choose one answer. a. s1 b. < c. s2 d. none
-
Classes
What error is caused by the following code ?class TemperatureList { public: TemperatureList( ); private: double * list; int size;};void func(Money amount);[...]int main{ TemperatureList list1; func(list1); return 0;}Choose one answer. a. double free b. divide by zero c. illegal argument d. no error
-
Copy Constructor
Explain what is copy constructor and what is the difference between copy constructor and overloaded assignment operator
-
-
Which of the following operators can not be overloaded
A) == b)++ c)?! d)
-
Inline functions advantages
What is the inline function and what is the use of inline function?
-
-
C++ conversion program
How can I write a program that convert a given number of millimeters into the equivalent length in meters and meters into the equivalent length in millimeters?Also draw flowchart,algorithm,output.
Binary
Write a program that continues to ask the user to enter any decimal number and calculate it’s binary,octal and hexadecimal equivalent.
C++ Macros Functionality
What is the main thing that C++ macros can do that cannot be done with functions? Give a realistically useful example of something of this kind.
Macros have the distinct advantage of being more efficient than functions, because their corresponding code is inserted directly into your source code at the point where the macro is called. There is no overhead involved in using a macro like...Constructor Use
Why the constructor is used?
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