cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Structure as part of a class?
Structure as part of a class?
Apr 30, 2011 at 3:41am UTC
Zap
(39)
can you have a structure as part of a class?
inside my class i am working with two parallel arrays, so it would be better if i could have that data as a structure rather than two separate arrays.
if possible an example would be appreciated.
Apr 30, 2011 at 4:06am UTC
firedraco
(6247)
Yes.
1
2
3
4
5
6
class
myclass {
struct
point {
int
x, y; } pt; std::string name; };
Apr 30, 2011 at 4:09am UTC
Zap
(39)
ok thanks!
Topic archived. No new replies allowed.