I have a project on school and i need to store 10^9 random numbers in an array for this purpose. I have tried a lot to do that but nothing is working. How can i store such big size random numbers? Please help.
If you're compiling a 32 bit program, there's a good chance that the solutions provided won't work because you're getting close to the maximum size of a 32 bit program.
As Duthomhas said, please explain the probem. There's a good chance that you don't have to store all of the those numbers at the same time.
@JLBorges, could you please explain me better this point? Why is ‘static’ so important in this situation? It seems I can pass and modify the array the usual way even if it’s not static. Is it just because it’s so big that the risk of losing it if it falls out of scope is too expensive or there’s something I can’t spot?
In almost every implementation, storage for objects with automatic storage duration is allocated from the run-time stack of the thread. The amount of storage available in the run-time stack is limited; the program can run out of stack space.