Object.h: #ifndef OBJECT_H #define OBJECT_H class Object { public: Object(); ~Object(); int getI(void); void setInfo(int i,char *name,double coord); private: int i; char *name; double coord; }; #endif Object.cpp: #include "Object.h" #include using namespace std; Object::Object() { //cout << "IN CONSTRUCTOR: " << this << " " << i << endl; } Object::~Object() { //cout << "IN DESTRUCTOR: " << this << " " << i << endl; } int Object::getI(void) { return i; } void Object::setInfo(int i,char *name,double coord) { this->i = i; this->name = name; this->coord = coord; } main.cpp: #include #include #include "Object.h" using namespace std; void main(void) { Object *ptr; ptr = new Object[6665536]; //cout << endl << "###" << ptr[10].getI() << "###" << endl; for (int x = 0;x < 6665536;x++) { ptr[x].setInfo(rand(),"fdsfsd",(double)(rand() / 3)); } /* for (int x = 0;x < 65536;x++) { cout << "x: " << x << " " << ptr[x].getI() << endl; } */ delete [] ptr; char c; while (true) { if (_kbhit()) { c = _getch(); cout << c; if (c == '~') break; } } }