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 is a try block?

822


Are php strings immutable?

764


Is python better than c++?

745


Program to check whether a word is a sub-string or not of a string typed

1778


Explain how would you handle a situation where you cannot call the destructor of a local explicitly?

709






What parameter does the constructor to an ofstream object take?

803


What is a set in c++?

695


What is prototype in c++ with example?

715


How long does it take to get good at leetcode?

867


Explain "const" reference arguments in function?

783


Describe delete operator?

816


What are libraries in c++?

772


Which software is used for c++ programming?

801


Define a conversion constructor?

791


What is one dimensional array in c++?

789