Write any small program that will compile in "C" but not
in "C++"
Answer Posted / murali
hi(){ }
g++ -x c++ -c test1.cpp
test1.cpp:1: ISO C++ forbids declaration of `hi' with no
type
gcc -x c -c test1.cpp
Here the default return type is int.
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
Why are pointers used?
How to implement is-a and has-a class relationships?
What is the need of a destructor? Explain with the help of an example.
How to access a variable of the structure?
What are the advantages of pointers?
What ANSI C++ function clears the screen a) clrscr() b) clear() c) Its not defined by the ANSI C++ standard
Is map ordered c++?
Can we define a constructor as virtual in c++?
When are exception objects created?
What are the general quetions are in DEna bank manager IT/System interviews?
C is to C++ as 1 is to a) What the heck b) 2 c) 10
Can non graphic characters be used and processed in C++?
List the issue that the auto_ptr object handles?
Can we specify variable field width in a scanf() format string? If possible how?
List the features of oops in c++?