Write any small program that will compile in "C" but not
in "C++"
Answer Posted / karunesh
int GetNum()
{
printf("this will compile under c but not in c++");
}
you will get a error under g++ funtion should return int
while in c i will work with warning.
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
What do you mean by persistent and non persistent objects?
What is a c++ object?
Where and why do I have to put the "template" and "typename" keywords?
What is a template in c++?
What is the this pointer?
Comment on assignment operator in c++.
What is null and void pointer?
What is protected inheritance?
What is the difference between equal to (==) and assignment operator (=)?
How can you specify a class in C++?
Who created c++?
What are references in c++? What is a local reference?
Can class objects be passed as function arguments?
What is prototype for that c string function?
What are destructors?