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 about the scope resolution operator?
What is setw manipulator in c++?
What are the storage qualifiers?
Is java a c++?
Do class declarations end with a semicolon?
How a new element can be added or pushed in a stack?
int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}
Write a function to find the nth item from the end of a linked list in a single pass.
What is searching? Explain linear and binary search.
Search for: what is pair in c++?
What is c++ similar to?
Explain bubble sorting.
Discussion on error handling of C++ .
What is the difference between a reference and a pointer?
How does list r; differs from list r();?