#include <stdlib.h>
#include <iostream>
#include <stdio.h>
#include <cstdlib>
#include <string>
#include <new>
class School{
private:
int schoolNumber;
public:
School(int _schoolNumber = 0) { schoolNumber = _schoolNumber;}
};
using namespace std;
int main(){
long int n = 500000000;
try{
School *shools = new School[n];
}
catch(bad_alloc& ex) {
cerr<<ex.what()<<endl;
system("pause");
exit(1);
}
catch(exception& ex) {
cerr<<ex.what()<<endl;
system("pause");
exit(1);
}
return 0;
}
Comments
Leave a comment