S
Shea Martin
I have been programming in C++ for over 4 years. I *think* I knew that
a struct could have a constructor but I decided to dig into it a little
more today, and found that there is very little difference between a
struct and a class in C++. Both have inheritance, access modifiers,
etc. The only diff I see is the default access level is public vs.
private.
I have always just used structs as a minimal class, as that is the way
they were used in textbooks.
Do structs have all these features in pure C? If not then why did c++
change them, when they were adding the Class type? Are there more
differences than those I have listed? Performance differences? I have
always just used structs as a minimal class, as that is the way they
were used in textbooks.
Thoughts, Ideas?
~S
a struct could have a constructor but I decided to dig into it a little
more today, and found that there is very little difference between a
struct and a class in C++. Both have inheritance, access modifiers,
etc. The only diff I see is the default access level is public vs.
private.
I have always just used structs as a minimal class, as that is the way
they were used in textbooks.
Do structs have all these features in pure C? If not then why did c++
change them, when they were adding the Class type? Are there more
differences than those I have listed? Performance differences? I have
always just used structs as a minimal class, as that is the way they
were used in textbooks.
Thoughts, Ideas?
~S