Why does my program crash when using fread in the constructor?
问题 I have a small program, written in C++ that contains a class with a large array. The class looks like this: class Test { public: Test(); ... private: int myarray[45000000]; }; Now, this array is read in from a file. I would like to do this with the constructor directly, instead of bothering to call any extra functions. The array only needs to be read in once, and afterwards will not change anymore. It has the exact size specified. My constructor looks like this: Test() { memset(myarray, 0,