Archived

This topic is now archived and is closed to further replies.

global struct - typedef & tag :: C++

This topic is 5587 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. I often use the use of typedef and tag used global struct in MFC. For example, worker threaders are often declared using a global struct. ----- typedef struct tagWORKERTHREAD { ... } WORKERTHREAD; ----- I would like to know what are the purpose of tag and typedef in a case like the example above. Why not use this declaration? ----- struct WORKERTHREAD { ... }; ----- Thanks, Kuphryn

Share this post


Link to post
Share on other sites
The first way is to make it C-compatible.

The second way is the C++ style.

A C compiler will not accept the second way, but a C++
compiler will accept both.



Kami no Itte ga ore ni zettai naru!

Share this post


Link to post
Share on other sites