outputting c to a file