Class or Structure
How do you know when to create a structure and when to create a class? For example, I could create my own texture structure, but I could also create my own texture class. I could even create both. So how do you know which to use?
Please don't limit your responses to dealing with textures only.
Thank you.
In what language? In C++, class and struct are the exact same thing except that a class has default private member access and inheritance, struct has default public member access and inheritance and they're spelled differently.
It's not even that much of a difference since you can still use private in structs and public in classes. In general, I use struct if everything is public and class otherwise. It's usually less typing that way.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement