Differentiate between “new” and “malloc” ?
1.) “new and delete” are preprocessors while “malloc() and free()” are functions. [we dont use brackets will calling new or delete]. 2.) no need of allocate... Read more »
1.) “new and delete” are preprocessors while “malloc() and free()” are functions. [we dont use brackets will calling new or delete]. 2.) no need of allocate... Read more »
1. Overload - two functions that appear in the same scope are overloaded if they have the same name but have different parameter list 2. main() cannot be overloaded 3.... Read more »
C Compilers do not allow class types so they do not support internal function reference table like a C++ compiler does. Instead, you can use a structure having members... Read more »
Slicing means that the data added by a subclass are discarded when an object of the subclass is passed or returned by value or from a function expecting a base class... Read more »
Name mangling is the process through which your c++ compilers give each function in your program a unique name. In C++, all programs have at-least a few functions... Read more »
The main characteristics of static functions include, It is without the a this pointer, It can’t directly access the non-static members of its class It can’t... Read more »
The scope operator can be used to refer to members of the global namespace. Because the global namespace doesn’t have a name, the notation :: member-name refers... Read more »
Class can have a public method for specific data type conversions. for example: class Boo { double value; public: Boo(int i ) operator double() { return value; } }; Boo... Read more »
C++ Storage Classes: auto: the default. Variables are automatically created and initialized when they are defined and are destroyed at the end of the block containing... Read more »
Reference is a name that acts as an alias, or alternative name, for a previously defined variable or an object. prepending variable with “&” symbol makes... Read more »
Method of passing arguments to a function which takes parameter of type reference. for example: void swap( int & x, int & y ) { int temp = x; x = y; y =... Read more »
a) Using const protects you against programming errors that inadvertently alter data. b) Using const allows function to process both const and non-const actual arguments,... Read more »
When derived class overrides the base class method by redefining the same function, then if client wants to access redefined the method from derived class through... Read more »
The term alignment primarily means the tendency of an address pointer value to be a multiple of some power of two. So a pointer with two byte alignment has a zero... Read more »
Multiple providers of libraries might use common global identifiers causing a name collision when an application tries to link with two or more such libraries. The... Read more »
A using declaration makes it possible to use a name from a namespace without the scope operator. Read more »
Constructor which initializes the it’s object member variables ( by shallow copying) with another object of the same class. If you don’t implement one in your... Read more »
Copy constructors are called in following cases: a) when a function returns an object of that class by value b) when the object of that class is passed by value... Read more »
Default assignment operator handles assigning one object to another of the same class. Member to member copy (shallow copy) Read more »
Constructor with a single argument makes that constructor as conversion ctor and it can be used for type conversion. for example: class Boo { public: Boo( int i... Read more »