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

Is there structure in c++?

806


What is flag in computer?

828


What is a pointer with example?

910


What are manipulators in c++ with example?

818


how to explain our contribution in the project?

3397


What is the difference between a pointer and a link in c ++?

803


What does obj stand for?

875


What is the benefit of learning c++?

749


What is the protected keyword used for?

879


What are the four main data types?

837


What is c++ and its features?

797


List the advantages of inheritance.

902


What's the order in which the objects in an array are destructed?

1184


Define macro.

855


What is overloading unary operator?

844