May I have a question as “Why following code compile fail with error C2371 at line 04” ?
It succeeded on VS6 but failed on VS2008.
I’ve tried to comment out line 05, still have this compile error.
01 typedef struct tagAAA
02 {
03 unsigned char a;
04 } AAA;
05 typedef AAA FAR* LPAAA;
Thanks in advance.
Presumably, the compiler gave an error message as well as a code, which told you what the problem is. Googling the code reveals:
You say that the error is on line 4; in that case, presumably the identifier is
AAA, and you’ve already declared something else calledAAA.As to why it succeeds on a 15-year-old pre-standard compiler, you’ll have to ask a historian.
Also, get rid of that
typedef structnonsense; it’s a bad idea in C, and completely pointless in C++. And unless you need to support 16-bit MS-DOS, get rid of thatFAR*nonsense too; you just need