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
What are all predefined data types in c++?
Can java be faster than c++?
What is a multiset c++?
Differentiate between a copy constructor and an overloaded assignment operator.
What are guid?
What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal
What is a base class?
What is a local variable?
Describe private, protected and public – the differences and give examples.
What is the disadvantage of using a macro?
What is an adjust field format flag?
How would you differentiate between a pre and post increment operators while overloading?
What is virtual base class?
What is a storage class?
What character terminates all character array strings a) b) . c) END