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

Answer Posted / balasubramani

main()
{
char a;
printf("string:");
scanf("%s",a);
getch();
}

this is correct if v compile in c
but it results in error when u code xactly the same in cpp
bcoz cpp needs cout n cin instead of printf n scanf :D lol

Is This Answer Correct ?    2 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is c++ considered difficult?

641


How does class accomplish data hiding in c++?

657


Do you know the use of vtable?

629


what is c++

1793


declare an array of structure where the members of the structure are integer variable float variable integer array char variable access all elements of the structure using dot operator and this pointer operator

1739






Can we use this pointer inside static member function?

621


Is map ordered c++?

591


What are the effects after calling the delete this operator ?

553


Write a program which employs Recursion

724


Where do I find the current c or c++ standard documents?

575


What is c++ hiding?

616


What is a storage class? Mention the storage classes in c++.

595


Explain the difference between new() and malloc() in c++?

620


Explain overriding.

602


How we can differentiate between a pre and post increment operators during overloading?

591