How large is the attributes can a class object hold? how to determine the stack/heap limit?-Collection of common programming errors
First of all since you’ve entitled this C++ and not C why are you using arrays? Instead may I suggest vector or, if contiguous memory is causing problems deque which relaxes the constraint on contiguous memory without removing the nearly constant time lookup.
Using vector or deque may also alleviate other seg fault issues which could plague your project at a later date. For instance, overrunning bounds in your array. If you convert to using vector or deque you can use the .at(x) member function to retrieve and set values in your collection. Should you attempt to write out of bounds, that function will throw an error.