Difference between printf and sprintf?
sprintf: a function that puts together a string, output goes to an array of char instead of stdout printf: prints to stdout Read more »
sprintf: a function that puts together a string, output goes to an array of char instead of stdout printf: prints to stdout Read more »
malloc: allocate n bytes calloc: allocate m times n bytes initialized to 0 Read more »
C++ places greater emphasis on type checking, compiler can diagnose every diff between C and C++ 1. structures are a way of storing many different values in variables... Read more »
1. Treated like macro definitions by C++ compiler. 2. Meant to be used if there’s a need to repetitively execute a small block if code which is smaller. 3. Always... Read more »
Constructor is a member function of the class, with the name of the function being the same as the class name. It also specifies how the object should be initialized.Ways... 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 »