I'm using VC++ 6 and need to declare an array of CPoints but don't know how many points will be in the array. Do you know how to declare an array of CPoints without specifying the the maximum number of CPoints that will be in the array?
I'm using VC++ 6 and need to declare an array of CPoints but don't know how many points will be in the array. Do you know how to declare an array of CPoints without specifying the the maximum number of CPoints that will be in the array?
You'll either have to use something like a vector or dynamically create the array using new (and delete).
........
int cpoints;
CPoint* pCPoint;
cout << "enter points: ";
cin >> cpoints;
pCPoint = new CPont[cpoints]; //CPoint needs default constructor
//Do stuff
delete [] pCPoint;