I've read explanations but to no avail. Could any one offer some explanation of what the difference is and what the benefits are of typedef, struct and classes?
spoonlicker
-20
Junior Poster
Recommended Answers
Jump to Poststruct and class are essentially the same thing, just with different default access. structs are public by default and classes are private.
typedef is a completely different beast, and I'm curious what kind of misunderstanding prompted you to lump them together. Perhaps this little trick from C to avoid …
Jump to PostAs Narue explained, a struct and a class are essentially the same. The only real difference is that members of a struct default to the public access level while members of a class default to the private access level, unless otherwise specified in the declaration of the struct/class.
In …
Jump to PostOkay, not being lewd here
You might want to look up the definition of lewd.
that sounds pretty...um....pointless.
You didn't specify which of the two things you consider pointless. For the similarities between struct and class, that's an understandable opinion, but there are good historical reasons for doing things that …
All 10 Replies
Narue
5,707
Bad Cop
Team Colleague
Fbody
682
Posting Maven
Featured Poster
spoonlicker
-20
Junior Poster
Narue
5,707
Bad Cop
Team Colleague
spoonlicker
-20
Junior Poster
Fbody
682
Posting Maven
Featured Poster
spoonlicker
-20
Junior Poster
Narue
5,707
Bad Cop
Team Colleague
spoonlicker
-20
Junior Poster
Narue
5,707
Bad Cop
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.