how could i get and set data on an array of objects? cant find a tutorial anywhere
Oct 6, 2012 at 9:50am UTC
so im looking into what this is...
class classname  is this an array of class objects?
if i wrote class classname  is that classname object number three or something else?
Oct 6, 2012 at 9:55am UTC
You would have gotten compilation errors.
Something like this should work.
2 3 4 5 6 class Classname
This is declaring an array of type
, with four elements.
For more info:
**This is the link to the full tut.
Hope it helps,
Last edited on
Oct 6, 2012 at 9:56am UTC
Oct 6, 2012 at 9:58am UTC
No, that's an array of 6 forward declarations of "
", which isn't valid C++. A declaration of an array takes this form:
// 6 "ClassName" objects.
Accessing the array takes this form:
The sub-script index is base-0, meaning that the index of the first element is 0, and the last is the array's
length - 1. An index is an offset from the first element that identifies different elements within the array.
Topic archived. No new replies allowed.