|
-
c++ problem
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?
PC Specs:
AMD 2500+, Shuttle AN35N Ultra Mobo, 512mb Buffalo Tech. PC3200 RAM, GeForce4 Ti4800SE, Chaintech AV-710, WD 80gb HD, Plextor 40/12/40A CD-Burner, Lite-On 16x DVD-Rom
Windows 2000 Pro SP4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|