int class, template;
Above code compiles fine with a C code but not with C++, as 'class' and 'template' are keywords in C++. But again, it's really a lame example.
A good example is the feature set of C99. Here are some codes that are valid in C but not in C++:
int vec[5] = { [1]=10, [3]=20 }; // designated initializers
typedef struct
{
char name[20];
int ID;
int age;
}Employee;
Employee emp = {.ID = 0, .age = 0};
int main()
{
}
The reason for not having the support for the C99 code in some major C++ compilers is that C++ was standardized in 98 and C99 standards came after that.
Will try to post more on this later.
1 comment:
Yourr the best
Post a Comment