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
What is scope resolution operator in c++ with example?
How do you invoke a base member function from a derived class in which you’ve overridden that function?
What do nonglobal variables default to a) auto b) register c) static
When do we run a shell in the unix system? How will you tell which shell you are running?
How much maximum can you allocate in a single call to malloc()?
what are Operators and explain with an example?
What is general form of pure virtual function? Explain?
What is the difference between a declaration and a definition?
How can you prevent accessing of the private parts of my class by other programmers (violating encapsulation)?
What are move semantics?
Can we make any program in c++ without using any header file and what is the shortest program in c++.
What is else syntax in c++?
Why do we use using namespace std in c++?
Do you know the problem with overriding functions?
What is new in c++?