Segmentation fault on boost::multi_array
问题 The following code gives a segmentation fault: #include <iostream> #include <fstream> #include "binItr.h" #include <boost/multi_array.hpp> using namespace std; int main(){ const char * xifile = "results/feretxiG1155V0P5T231K10.bin"; const uint pSize = 5; const uint T = 231; ifstream xiFileId(xifile, ios::binary); typedef boost::multi_array<uint, 2> array_type; array_type xi(boost::extents[T][pSize + 1]); //the ii_t class in the following line is taken from http://stackoverflow.com/questions