why c++ is not called strictly d super set of c?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Will rust take over c++?
Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;
What are the rules about using an underscore in a c++ identifier?
What is the basic of c++?
What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal
What do you mean by persistent and non persistent objects?
What is the error in the code below and how should it be corrected?
When the design recommends static functions?
List out some of the object-oriented methodologies?
what is the order of initialization for data?
10 Answers Amazon, TCS, Wipro,
structure that describe a hotel with name, address,rooms and number of rooms
What is a block in c++?