Question - Differences of C and C++
Answer -
Could you write a small program that will compile in C but not in C++ ?
In C, if you can a const variable e.g.
const int i = 2;
you can use this variable in other module as follows
extern const int i;
C compiler will not complain.
But for C++ compiler u must write
extern const int i = 2;
else error would be generated.
Bitwise Operations - Given inputs X, Y, Z and operations | and & (meaning bitwise OR and AND, respectively), what is output equal to in?
output = (X & Y) | (X & Z) | (Y & Z);
C++ Object-Oriented Interview Questions And Answers