I was trying to implement the sieve of eroathoses (I know I spelt this wrong) and it works. But i was trying to find all prime under 2 million.
The .cmd for visual studio just corrupts if I try to find all prime under 2million. I am guessing It's because overflow or something but I don't know for sure.
can you give me some hints on how to fix my code so the program won't corrupt. here is the code:
I mean that when i try to find the all prime numbers below 2 million,
the program corrupts, but if i try to find all prime number below say 2000, it works perfectly. Try the program to see what i mean.
I don't get why it does not work for a large number.
When you create a pointer to a type you reserve enough space in memory for the the variable. When you call new you actually allocate the memory to the program so it cannot be used by another program.
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.