Structures, Class, constructor :o)
The constructor is a function repeated once for every created object. If you want 50 particles say in the struct definition "particle particlearrayname[50];" If you have a default constructor for the class particle(one with no arguments) it will be used for each object in the array. Functions, like constructors, cannot be specified as data members of a struct. If the struct has data members as specified above a new array of 50 particles will be created everytime you create an instance of that type of struct.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement