why use structure if class is better?

why use structure if class is better?

isn't class just plain better than structure. if so why use structure?
closed account (zb0S216C)
As you already know, classes and structures are identical, except that the default access-specifier for class is private, whereas the default access-specifier for struct is public. However, struct is mostly used for C-style POD types, and class is used for inheritance and such.

Wazzak
Last edited on
didnt know that thanks
(also default inheritance works same way as default access).
Topic archived. No new replies allowed.