Hello, I'm a complete noob to c++ programming. Anyway, for practice, I was working on a program to find prime numbers. I have it storing all the primes in an array. It's also set up to record how long the program takes. I set it to 10,000 primes, it took .3 seconds. 100,000 primes, 4 seconds. So why not try 1 million? Might be a good way to benchmark my computers, like the program that finds pi to a million digits. Well, it crashes if I try a million. I tried some various other numbers, pretty much anything above 250,000 crashes it. Why? I mean, its 4 bytes per number, so 1 million digits would only be 4mb of ram needed. I have 512.

So is there some kind of limit or what? And is there an easy way around this?