-
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...
Binary Search Algorithm
Why Binary Search Algorithm is a device and conquer based algorithm?
Ans