I know there are some difference between ANSI C 89 and C that supports by C++.
for example in ANSI C 89, you should declare variables at first line of blocks.
or when you want to declare struct
variables, you should use struct
keyword (eg struct student std1;
).
or // is not valid for commenting and you should use /**/ for commenting in ANSI C 89.
for example this C code is not valid in ANSI C 89:
struct student
{
char* name;
};
enum number
{
ODD,
EVEN
};
void test()
{
printf("Hello world!");
int a, b; // Not valid in ANSI C 89, variables should declare at first line of blocks.
student std1; // Not valid. It should be: struct student std1;
struct student std2; // Valid.
number n1 = ODD; // Not valid.
enum number n2 = EVEN; // Valid.
}
I want to develope an application using ANSI C 89 and my question is:
What is the difference between ANSI C 89 and C that supports by C++?