How do they help with coding? They don't seem like it makes the code shorter so I'm confused... maybe I'm doing it wrong but...
could anyone explain to me about enums and structures please?
It'd be greatly appreciated, Merry Christmas!
lolwaht
0
Newbie Poster
Recommended Answers
Jump to PostStructures are intended for grouping data together, which can then be worked on as a unit - you can have pointers to structures, pass them as function arguments and returns, etc. Structures make it feasible to work on more complex data structures such as linked lists, trees, heaps, and so …
Jump to PostSo, there is only a very trivial difference between a
struct
and aclass
. Andstruct
was kept for backward compatibility with C, whileclass
was introduced because it is generally more appropriate for Object-Oriented Programming purely on the basis of vocabulary (i.e. in OOP …
Jump to PostSigh. That is incorrect. Classes and structs are no different in C++ except for the fact that by default, structs uses 'public' and classes uses 'private' as an access specifier.
cringes at own mistake You are correct, of course, and I should have been more careful in what I wrote.
…
All 9 Replies
MandrewP
60
Junior Poster in Training
lolwaht
0
Newbie Poster
mrnutty
761
Senior Poster
Schol-R-LEA
1,446
Commie Mutant Traitor
Featured Poster
mrnutty
761
Senior Poster
mike_2000_17
2,669
21st Century Viking
Team Colleague
Featured Poster
Schol-R-LEA
1,446
Commie Mutant Traitor
Featured Poster
mrnutty
commented:
All good, live and learn bro
+13
Tumlee
42
Junior Poster in Training
mrnutty
761
Senior Poster
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.