Hi!
I'm just learning about C/C++, and I would like to ask the experts here about the difference between the two pieces of code below. From what I know (which is not a lot), these two pieces of code should be the same. But somehow, I feel that there's a subtle difference, since the author from whom I got this code knows his stuff and deliberately chose to write these two pieces of code this way.
So my question is: is there a difference in these two typedefs? Because if there are none, he should have just written the second struct in the same way as the first one, saving himself additional typing.Code:// first typedef ////////////////////////////////// typedef struct { //fields here... } firstStruct; // second typedef ///////////////////////////// typedef struct struct2 secondStruct; struct struct2 { //fields here... };
Thanks.