Write any small program that will compile in "C" but not
in "C++"

Answer Posted / karunesh

int GetNum()
{

printf("this will compile under c but not in c++");

}

you will get a error under g++ funtion should return int
while in c i will work with warning.

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is abstraction in c++ with example?

565


Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).

638


Is c++ primer good for beginners?

593


What is the identity function in c++? How is it useful?

554


write a function signature with various number of parameters.

569






What is the arrow operator in c++?

563


What is the latest c++ standard?

689


Can class objects be passed as function arguments?

611


What is a c++ vector?

598


How much do c++ programmers make?

569


Is c++ a difficult language?

579


How many static variables are created if you put one static member into a template class definition?

569


What is a hash function c++?

556


Is main a class in c++?

568


How is objective c different from c++?

796