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


Please Help Members By Posting Answers For Below Questions

Write about the scope resolution operator?

618


What is setw manipulator in c++?

600


What are the storage qualifiers?

665


Is java a c++?

565


Do class declarations end with a semicolon?

604






How a new element can be added or pushed in a stack?

583


int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}

837


Write a function to find the nth item from the end of a linked list in a single pass.

571


What is searching? Explain linear and binary search.

587


Search for: what is pair in c++?

593


What is c++ similar to?

601


Explain bubble sorting.

628


Discussion on error handling of C++ .

649


What is the difference between a reference and a pointer?

601


How does list r; differs from list r();?

695