why c++ is not called strictly d super set of c?
Answer Posted / astha biswas
there are some key-words like class , new etc which can be
used as identifiers in c. so if we save program in .c using,
new as an identifier, it will not show any error; but if we
save the same program in .cpp, it will show error as new is
an operator in c++.
EX:
#include<stdio.h>
#include<conio.h>
void main()
{
int new;
clrscr();
new=3;
printf("%d",new);
}
if we execute this program in .c, output will be 3.
but if we execute this program in .cpp; then it will show 2
errors.
1. declaration terminated incorrectly.
2. lvalue required.
Is This Answer Correct ? | 10 Yes | 1 No |
Post New Answer View All Answers
Can I have a reference as a data member of a class? If yes, then how do I initialise it?
How static variables and local variablesare similar and dissimilar?
Describe linkages and types of linkages?
When is the destructor called?
Is swift faster than c++?
Can a program run without main?
If dog is a friend of boy, is boy a friend of dog?
You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. New() and malloc()
What is polymorphism & list its types in c++?
Why is c++ is better than c?
Where is atoi defined?
write a corrected statement so that the instruction will work properly. if (4 < x < 11) y = 2 * x;
What are the uses of pointers?
What is the difference between struct and class?
How can a called function determine the number of arguments that have been passed to it?