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 an adaptor class or wrapper class in c++?

637


What is pointer in c++ with example?

560


What is runtime polymorphism in c++?

626


What are the differences between the function prototype and the function defi-nition?

653


What is the c++ programming language used for?

607






Are c and c++ similar?

618


Which software is used for c++ programming?

651


How do you find out if a linked-list has an end?

698


What kind of problems can be solved by a namespace?

639


What is the last index number in an array of 100 characters a) 100 b) 99 c) 101

626


What are the advantages of c++ over c?

624


Describe the role of the c++ in the tradeoff of safety vs. Usability?

747


What are advantages of c++?

599


Explain the differences between list x; & list x();.

633


What are separators in c++?

659