Problem Source: http://www.cskaoyan.com/viewthread.php?tid=244542&pid=1593533&page=1&extra= #pid1593533
My answer:
First of all, on the structure of the supplement, the domestic classic textbook-Tan Haoqiang's "C + + programming" clearly stated:
1, in C language, the definition of the structure of the variable format: struct A;
2, in C + +, the definition of the structure of the variable format: a A;
In addition, C + + retained the style, that is, C + + can be struct a A, also can use a, Mr. Tan suggested a new way of writing A;
So the question can be answered as follows:
(1) in C language (or C-style program):
Using the typedef struct A{}A You can define a struct variable without having to write struct A, which is written directly into a (a is the typedef struct A{}A after a), in order to omit struct to make the program more concise;
The use of the typedef struct a{} to define the structure variables must be written struct a A, can not omit struct;
(2) in the C + + language (or C + +-style programs):
In C + + generally will not appear typedef struct A{}A Such superfluous form, the reason may be divided between C and C + +;
In addition, the structure of C and C + + is also a little different: C structure can not contain functions, C + + structure may contain functions, but generally do not do so instead of using the method of the class implementation.
Note: The king of the single book "Data Structure" is the use of C language.