Jump to content
  • Advertisement
Sign in to follow this  
zychrias

struct versus class

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

In my Google, Gamedev.net, and in books I've seen the only difference between Struct and Class is the private and public modifiers. What am I asking is if there are any other differences such as memory requirements and the usual noticable differences in how they are laid out?

Share this post


Link to post
Share on other sites
Advertisement
As snk_kid said.

Also I've found that with microsoft's compiler, if you forward declare something it has to be the same as the actual declaration and previous forward declarations. So in MSVC you can't have a class and forward declare it as a struct. I'm not sure whether this is standard or not.

class Jigger;
class Jigger;//multiple forward declarations are fine
struct Jigger;//not allowed in MSVC

Also, as always, see the C++ FAQ Lite

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!