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
What doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required
Write a function that swaps the values of two integers, using int* as the argument type?
What are friend classes?
Define a pdb file.
What is pure virtual function? Or what is abstract class?
List down the guideline that should be followed while using friend function.
What is std :: endl?
What is struct c++?
What are advantages of using friend classes?
Can a program run without main function?
Assume studentNames and studentIDs are two parallel arrays of size N that hold student data. Write a pseudocode algorithm that sorts studentIDs array in ascending ID number order such that the two arrays remain parallel.
What is a forward referencing and when should it be used?
what is COPY CONSTRUCTOR and what is it used for?
What do you mean by function overriding & function overloading in c++?
Explain the use of vtable.