Thought I'd also have a go at translating ch-1.pl and ch-2.pl into C.. Both C versions produce identical (non-debugging) output to my Perl originals ch-1.c uses primes.[ch], a prime number generator module that I wrote ages ago, and I've finally split out the command-line argument processing code into args.[ch].