in reply to sprintf minor problem

I'm confused as to why you'd use sprintf, then use its return as an argument for print. Why not just use printf to output the entire string you're trying to produce?
printf("%5.5dhello", 1);