#include #include "PixelTimeInfo.h" #include using namespace std; int main(){ //Pixel::OpenCalibFile(); PixelTimeInfo::OpenCalibFile(); //prepare the input (assume it may come from an external source) Pixel * Pointers[20]; for(int i=0;i<10;i++)Pointers[i]=new Pixel(i); for(int i=10;i<20;i++)Pointers[i]=new PixelTimeInfo(i, i*100); //this part is polimorfic! any re-defined method is called correctly depending on the type at runtime. for(int i=0;i<20;i++)Pointers[i]->Print(); //the same does not work with instancies //the methods as defined in the mother are always called. Pixel Array[20]; for(int i=0;i<10;i++)Array[i]=Pixel(i); for(int i=10;i<20;i++)Array[i]=PixelTimeInfo(i, i/100.); for(int i=0;i<20;i++)Array[i].Print(); PixelTimeInfo::CloseCalibFile(); //Pixel::CloseCalibFile(); return 0; }