I want to create an array that is capable of storing 10^9 numbers(long int).If i try doing this my compiler crashes.What is the maximum size array allowed in C++.Also if i d
I want to create an array
Do you really need an array? In other words, do you require your integers to be in one memory block, or you simply want to access them by index? If you don't care about the memory layout, but still want to have fast access to elements, you should use std::deque. Instead of allocating one chunk of memory, it'll store your numbers in many small chunks, so as long as you have enough memory to store all your numbers together, you'll be fine.