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
What is the use of cmath in c++?
In int main(int argc, char *argv[]) what is argv[0] a) The first argument passed into the program b) The program name c) You can't define main like that
How do you add an element to a set in c++?
Explain dangling pointer.
Can you use the function fprintf() to display the output on the screen?
What do you mean by “this” pointer?
Is c++ the best programming language?
What is #include c++?
What is the difference between the parameter to a template and the parameter to a function?
How do you sort a sort function in c++ to sort in descending order?
In what situations do you have to use initialization list rather than assignment in constructors?
How a pointer differs from a reference?
What is the best book for c++ beginners?
Is dev c++ a good compiler?
How const int *ourpointer differs from int const *ourpointer?