脰枚 Tiib <> writes:
> On Sunday, 23 September 2012 13:50:03 UTC+3, David Brown wrote:
[...]
>> The only time I would write "struct table;" would be to define a forward
>> declaration for lists, trees, etc. And then I would later write
>>
>> "typedef struct table table;"
>
> The additinal bonus when you do that is that C++ does exactly the same typedef
> implicitly. C++ compiler has to compile if it is said out explicitly
> as well. As result you can use the definition in both languages:
>
> typedef struct table { ... } table;
>
> No additional preprocessor magic is needed.
Personally, I wouldn't bother with the typedef either in C or in C++.
In C I'd refer to the type as "struct table"; in C++, I'd refer to
it as "table".
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
Will write code for food.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"