Hi friends, I wrote a code to build a matrix with specific calculations. When I'm using 3000 elements works well ... But I did a test with 150.000 (150.000 x 150.000) and I had problems. " terminate called after throwing an instance of 'std::bad_alloc' " I'm copying the code part of the problem: void buildMatrix(ofstream &myfileOutSubsetZ, ofstream &myfileOutSubset,ofstream &myfileOut,ofstream &myfileLog,vector<string> &vetorInd) { float **AAA = 0; AAA = new float *[vetorInd.size()]; for(int i=0;i<vetorInd.size();i++) AAA= new float [vetorInd.size()]; // PROBLEM! ... I captured the exception: "St9bad_alloc". Can you help me please?