typedef TArray<CShape*> CShapes;
typedef TArrayIterator<CShape*> CShapesIterator;
CShapes *shapes = new CShapes(10, 0, 10);
void TDrawWindow::save()
{
ofstream os("c:\\abc.txt");
CShapesIterator i(*shapes );
while (i) {
CShape *p = i++;
os<<p;
}
}
is it correct or not?
if it is correct then how to retrive it from file
I have done so but it is not working.
void TDrawWindow::Open()
{
ifstream is("c:\\abc.txt");
shapes ->Flush();
unsigned numPoints;
is >> numPoints;
while (*numPoints--) {
CShape shape;
is >> shape;
shapes->Add(&shape);
}
Invalidate();
}
