file.h:
extern objekt squares[120];
file.cpp:
objekt squares[120]= {objekt(objekt_size ,objekt_size ,-111,0)};
How can I init all objects at one time, all with the same parameters?
file.h:
file.cpp:
How can I init all objects at one time, all with the same parameters? |
|||||
|
Don't use a raw array (because all the elements will be initialised via the default constructor). Use e.g. a
|
|||||||||||||
|
You can also use the preprocessor to repeat the same code 120 times.
|
|||
|