Jump to content
  • Advertisement

Archived

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

kuphryn

global struct - typedef & tag :: C++

This topic is 5778 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
Advertisement
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
Oh. Interesting. Thanks.

I thought the use of typedef and tag serve a specific purpose for Windows programming.

Kuphryn

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!