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 dynamic and static typing?

898


What are structures and unions?

792


Which is not a valid keyword a) public b) protected c) guarded

1007


Is c++ a high level language?

753


How is static data member similar to a global variable?

851


What kind of jobs can I get with c++?

829


Define a pdb file.

846


Define macro.

833


What it is and how it might be called (2 methods).

866


What are the various access specifiers in c++?

803


write a porgram in c++ that reads an integer and print the biggest digit in the number

2023


What is the object serialization?

866


Explain pass by value and pass by reference.

803


Why ctype h is used in c++?

724


Difference between inline functions and macros?

781