as it seams you can do something like printf ("A%*s%s/\n", -5, "B", "CC"); and it will print the padding to the left