Jump to content
  • Advertisement
Sign in to follow this  
Timptation

C++ struct declaration question

This topic is 3074 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

Advertisement
In modern C++, basically none. I would prefer the former. You won't be able to have a custom constructor or destructor with the latter.

typedef struct { ... } structName; is an old practice from the days of C, where you would always have to type out "struct structName" instead of just "structName" for every variable and parameter unless you used a typedef. But that's not required in C++.

Share this post


Link to post
Share on other sites
Thanks for the quick reply! That's pretty much what I had assumed, that it was an old C leftover. I appreciate the "where it comes from" explanation.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!