About Me

All about Real time requirements in Orale Stay Tune!!

Monday, March 17, 2008

Differences of C and C++

Differences of C and C++ ?

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);


0 comments: