You're not understanding what I said about
stdbool.h. When you include it, you use
bool instead of
_Bool. You also get rid of your
TRUE and
FALSE declarations and just use
true and
false instead (which are defined, along with bool, in stdbool.h).
Also, you ignored my point about
= vs
==. You're using the wrong one when testing
isPrime after the loop.
Anyway, the 10th prime is 29. Your code (as is) returns 11, the 5th prime. So it's off by way more than 1.
Also, a timing update for anyone who's interested (probably nobody
). Due to an error in my sieve code, it was slower than it should have been. Now it finds the millionth prime in 0.065 seconds, the 50 millionth in about 15 seconds, and the 100 millionth in about 32 seconds.