In C, we cannot access a global variable if we have a local variable with same name, but it is possible in C++ using scope… Read More »
Don’t write a copy constructor if shallow copies are ok: In C++, If an object has no pointers or any run time allocation of resource… Read More »
In C, it might not be possible to have function names on left side of an expression, but it’s possible in C++.
In C, data type of character constants is int, but in C++, data type of same is char.
In C++, following operators can not be overloaded: . (Member Access or Dot operator) ?: (Ternary or Conditional Operator )
A quine is a program which prints a copy of its own as the only output. A quine takes no input. Quines are named after… Read More »
In C++, a Copy Constructor may be called in following cases:
Consider the below program.
C allows a void* pointer to be assigned to any pointer type without a cast, whereas C++ does not; this idiom appears often in C… Read More »
Uninitialized pointers are known as wild pointers because they point to some arbitrary memory location and may cause a program to crash or behave badly.
In C, sizeof operator works on following kind of operands:
Following are the things which a derived class inherits from its parent. 1) Every data member defined in the parent class (although such members may… Read More »
In the below code, change/add only one character and print ‘*’ exactly 20 times.
What should be the “condition” so that the following code snippet prints both HelloWorld !
Here is an implementation.