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


Please Help Members By Posting Answers For Below Questions

What is #include math h in c++?

581


what Is DCS ? what i will get benefit when i did?

1844


What is the difference between delegation and implemented-in-terms-of?

535


What is struct c++?

580


Name the operators that cannot be overloaded in C++?

592






what is c++

1814


Inline parameters : What does the compiler do with the parameters of inline function, that can be evaluated in runtime ?

2025


the first character in the variable name must be an a) special symbol b) number c) alphabet

613


Why c++ is created?

590


Explain method of creating object in C++ ?

605


Why namespace is used in c++?

613


Is string an object in c++?

666


What does flush do c++?

574


What does namespace mean in c++?

564


Explain container class.

703