hi guys i have my C++ code in which i have created a new class and in this class i define the variables and the strucutre of a coil, so when the user clicks the left mouse button on the document it draws a coil, ive also got this to save using the serialize, now i would like to be able to create and array of this coil so when the user draws more than one it saves them all not just the last one drawn,
would i go about creating an array like this
CODE
MyCoil mycoil[32] //my coil being the reference to that class. and being that the maximum number of coils that can be drawn is 32 at anytime.
int n=0;
from there how would i go about creating a coil like so? when the user clicks the left mouse button
CODE
n=n+1
mycoil[n-1].x=point.x;
mycoil[n-1].y=point.y;
invalidate()
and then in on draw so when the screen is refreshed it draws it all automatically
CODE
for (1=0; i<n){
mycoil[i].x;
mycoil[i].y;
}
and would i then use the same kind of loop when im saving the item??
im kind of lost on the way to work the array. so if anybody has any good ideas or any sort of good way of describing how i should implement this i would be very greatful
thanks
dan