Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What is the purpose of templates in c++?

989


What is singleton class in c++?

988


Explain some examples of operator overloading?

1039


Write a Program to find the largest of 4 no using macros.

1034


Write about the use of the virtual destructor?

961


What is ios in c++?

1162


What are the types of container classes?

1087


What is lazy initialization in c++?

1054


How to declaring variables in c++?

1108


How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1039


Out of fgets() and gets() which function is safe to use?

1073


What is a manipulator in c++?

1173


What is abstract class in c++?

988


Why do we use structure in c++?

1005


Do you need a main function in c++?

1079