Thanks for the replies.
What is GDB?
You're right- the casting was all wrong- I didn't want to do any casting, I just substituted some code for other code, not knowing what I was doing.. got the casting out and lo! It produced some output.
Okay. Trying to explain my situation better:
The program that is given- I need to make 3 concurrently running threads, that do not share any variables, that can complete this task. (The program computes the number of primes, given by which_prime). My first thought was to split into 3 threads. If n = 100, the first thread computes 1..33, second computes 34..66, last computes 67..100. Okay. But for the second thread to compute the 34th prime number, it needs to know the 33rd prime number, right? Of course, the first thread could return the 33rd, then let the 2nd thread go, but now that's not concurrent. Also, I could use a shared variable to let each start where the last left off, but now they're sharing variables!
Actually, here's exactly what the assignment is:
http://math-cs.cns.uni.edu/~gray/project01.pdf
How can I get around this? I'm beginning to hate this project because it seems not like a "programming project", but a "try to figure this out, and if you can't think outside the box you're screwed"..