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
Write a program to interchange 2 variables without using the third one.
Does c++ support multilevel and multiple inheritances?
How does class accomplish data hiding in c++?
Why is c++ not purely object oriented?
What is this pointer in c++?
What is #include ctype h in c++?
What is the difference between prefix and postfix versions of operator++()?
What is the meaning of string in c++?
What are structures and unions?
What is srand c++?
What are the two types of comments, and how do they differ?
What is abstraction with real time example?
What is the most useful programming language?
Name the debugging methods that are used to solve problems?
If I is an integer variable, which is faster ++i or i++?