Hi,

My assignment for class was to produce a program that runs the seive of eratosthenes to determine all the prime numbers between 2 and n, with n no larger than 100. I tryed to write the program with a boolian array that will turn all non-primes to false up to the max of 100, and then only output to the requested input of n.

Quite honestly, this confuses me and I am not even sure I have the process right, let alone the program. As is, I am getting an unresolved external error upon linking. Line 38 is what I am most unsure of, and for some reason think my error is there.

Any advice or help on getting this thing running would be much appriciated. How am I doing?

Thanks.--Will

OK, I got a bit further and think I have the basic idea down, however, I am still getting the unresolved externals message. Attatched is my improved code. Thanks. Will

Hi,

My assignment for class was to produce a program that runs the seive of eratosthenes to determine all the prime numbers between 2 and n, with n no larger than 100. I tryed to write the program with a boolian array that will turn all non-primes to false up to the max of 100, and then only output to the requested input of n.

Quite honestly, this confuses me and I am not even sure I have the process right, let alone the program. As is, I am getting an unresolved external error upon linking. Line 38 is what I am most unsure of, and for some reason think my error is there.

Any advice or help on getting this thing running would be much appriciated. How am I doing?

Thanks.--Will

Member Avatar
Siersan

What errors you are getting? It compiles and runs just fine for me except every prime is 1 larger than it should be because you add 1 to m when printing.