Write any small program that will compile in "C" but not
in "C++"

Answer Posted / tareq

<code>
int class;
</code>

$gcc a.c -c; echo $?
0

$g++ a.c -c; echo $?
a.c:1: error: expected identifier before ';' token
a.c:1: error: multiple types in one declaration
a.c:1: error: declaration does not declare anything
1

Is This Answer Correct ?    1 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by persistent and non persistent objects?

742


What is the use of endl in c++ give an example?

618


What is an incomplete type in c++?

772


What is the difference between #import and #include?

555


What is the difference between global int and static int declaration?

416






How does c++ sort work?

569


What are the rules for naming an identifier?

565


What is a singleton c++?

552


Explain data encapsulation?

612


Explain queue. How it can be implemented?

680


Explain about Garbage Collector?

652


How do you save a c++ program?

561


Why are pointers not used in c++?

629


What are move semantics?

675


Is sorted c++?

581