#include #include int main() { using namespace std; int anzahl = 1000; int *ptr = (int*) malloc(anzahl*sizeof(int)); if (ptr != NULL) { ptr[0] = 0; ptr[anzahl-1] = 999; // ... cout << ptr[0] << "..." << ptr[anzahl-1] << '\n'; free(ptr); } else { cerr << "Nicht genug Speicher vorhanden.\n"; } }