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
General Struct question:
General Struct question:
Jul 28, 2015 at 1:05pm UTC
homing
(114)
hey,
i've rarely used structs in c++, but want to use one now:
is the following a good way to create a struct?
1
2
3
4
5
struct
{ Object* item1; Object* item2; }Pair;
Do I understand this kind of struct correctly?:
Pair will be the only object of this struct, and its not possible to create other objects?
Last edited on
Jul 28, 2015 at 1:05pm UTC
Jul 28, 2015 at 3:24pm UTC
Computergeek01
(5613)
Yes? In this case 'Pair' is the identifier, just like it would be with a class. The
only
difference between the two is the default data member accessibility.
Topic archived. No new replies allowed.