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 do you mean by persistent and non persistent objects?
What is the use of endl in c++ give an example?
What is an incomplete type in c++?
What is the difference between #import and #include?
What is the difference between global int and static int declaration?
How does c++ sort work?
What are the rules for naming an identifier?
What is a singleton c++?
Explain data encapsulation?
Explain queue. How it can be implemented?
Explain about Garbage Collector?
How do you save a c++ program?
Why are pointers not used in c++?
What are move semantics?
Is sorted c++?