How can I store a large number of elements in an array?
Tell me how to store data, the amount of which exceeds the maximum value of the int type? You can't use the index ...C++ Isaiah Hall, Jul 14, 2020
If I'm not mistaken, size_t is used as the array index, which corresponds to the maximum memory size for a processor with a given bit rate. That is, the situation you described cannot happen in principle.
Instead of a thousand words.Daphne Guerra
Use long type for index.
and for storage, use several arrays of the maximum size and, depending on the index value, calculate the real index of the desired arrayEli Noble
relative to any language, you can build a structure in which there will be an array of references to other arrays and the GetValue function with any type as a parameter, then determine in which array this element lies, for example, as a result of dividing the parameter by the maximum number of elements in the array, the remainder of this division will be the number of the element in the array. But in fact, the presence of a need for such a large array indicates the incorrectness of the application architecture, the task itself needs to be revised.Anonymous
Thanks for answers!Anonymous
How are you going to work with such data sizes at all? Here it is already necessary to dig in the direction of displaying files in memory.Anonymous
To place the code, please use CodePen or similar tool. Thanks you!