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?

Answers were Sorted based on User's Feedback



why c++ is not called strictly d super set of c?..

Answer / 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

why c++ is not called strictly d super set of c?..

Answer / bijayalaxmi behera.

In the strictly mathematical sense,c++ is not strictly super
set of c.Because,there are some programs that are valid c
but not valid c++.One more thing,few ways of writing the
code that has a different meaning in c and c++.

Is This Answer Correct ?    5 Yes 1 No

why c++ is not called strictly d super set of c?..

Answer / subhashree das

there are some operators in c++; which can be used as
identifiers in c. so if we execute the program in .c it will
not show any error, where as if we execute the same program
in .cpp , it will show error.

Is This Answer Correct ?    5 Yes 1 No

Post New Answer

More C++ General Interview Questions

What is "strstream" ?

1 Answers   Huawei,


Write a program to swap 2 chars without using a third varable? char *s = "A"; char *p = "B";

7 Answers   CTS,


is throwing exception from a constructor not a good practice ?

5 Answers   Ericsson,


Explain the differences between private, public and protected and give examples.

0 Answers  


Implement stack operations with pointers with appropriate exception checks.

0 Answers   Huawei,


What is the difference between a reference and a pointer?

0 Answers  


How much is c++ certification?

0 Answers  


Difference between linked list and array?

3 Answers  


What do the header files usually contains?

0 Answers  


Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?

0 Answers  


How do you import payscale data from non SAP to SAP?is it through LSMW or any other way is there?

0 Answers  


Explain the operation of overloading of an assignment operator.

0 Answers  


Categories