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
What is a try block?
Are php strings immutable?
Is python better than c++?
Program to check whether a word is a sub-string or not of a string typed
Explain how would you handle a situation where you cannot call the destructor of a local explicitly?
What parameter does the constructor to an ofstream object take?
What is a set in c++?
What is prototype in c++ with example?
How long does it take to get good at leetcode?
Explain "const" reference arguments in function?
Describe delete operator?
What are libraries in c++?
Which software is used for c++ programming?
Define a conversion constructor?
What is one dimensional array in c++?