Structures, Class, constructor :o)

Started by
9 comments, last by Allebarde 21 years, 10 months ago
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