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
Is rust better than c++?
the maximum length of a character constant can be a) 2 b) 1 c) 8
Snake Game: This is normal snake game which you can find in most of the mobiles. You can develop it in Java, C/C++, C# or what ever language you know.
Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.
What is iomanip c++?
Mention the purpose of istream class?
What is setiosflags c++?
Difference between a copy constructor and an assignment operator.
Define the operators that can be used with a pointer.
What are the advantages of c++ over c?
write a corrected statement so that the instruction will work properly. if (4 < x < 11) y = 2 * x;
Explain the differences between private, public and protected and give examples.
If you push the numbers (in order) 1, 3, and 5 onto a stack, which pops out first a) 1 b) 5 c) 3
Please explain class & object in c++?
What is general format for a prototype?