Thursday, 2 August 2012

Is there something we can do in C but not in C++?

The answer is Yes and its seems to be funny but the interviewer may trouble you on this..

Declare variable names which are keywords in C++ but not C.


#include < stdio.h >
int main(void)
{
int  new=3,delete=4;
return 0;
}


this above code will compile in c compiler but not in c++ compiler because new,delete are keywords specific to c++ and they are not in c.

No comments:

Post a Comment