rar @ Wed Sep 30, 2009 1:03 pm wrote:
In my assignment, I am required to space out the output so that it is neatly organized in columns.
I'm sure this is something that must be done frequently, so what is the best way to go about doing it? Friends of mine have been suggesting/
attempting just putting spaces/tabs in the code, but I haven't found this to be successful.
Google for "man printf". There is a minimum field width you can set. As long as you set the field width to be sufficiently large, you will get columns. Also, check out the "-" you can add like "%-10s" to change between left and right justification.