In C++, if a class has a constructor which can be called with a single argument, then this constructor becomes conversion constructor because such a constructor allows automatic conversion to the class being constructed.
In C++, friendship is not inherited. If a base class has a friend function, then the function doesn’t become a friend of the derived class(es).
In C++, RTTI (Run-time type information) is available only for the classes which have at least one virtual function.
In C++, class variables are initialized in the same order as they appear in the class declaration.
In C printf(), %n is a special format specifier which instead of printing something causes printf() to load the variable pointed by the corresponding argument with a value equal to the number of characters that have been printed by printf() before the occurrence of %n.
Ideally delete operator should not be used for this pointer. However, if used, then following points must be considered.
In C++, delete operator should only be used either for the pointers pointing to the memory allocated using new operator or for a NULL pointer, and free() should only be used either for the pointers pointing to the memory allocated using malloc() or for a NULL pointer.
In C and C++, comma (,) can be used in two contexts:
Following are the differences between malloc() and operator new.
In C++, a static member function of a class cannot be virtual. For example, below program gives compilation error.
Consider the below C/C++ program.