Hey guys, quick question. Is there anything in C (working in Linux here) that allows you to format output into even looking columns even if the corresponding output is printed horizontally? ..err, that's hard to explain. Basically I've got some code that performs DNS lookups on a list of machines (functionality is irrelevant to my question) and outputs the results. Right now, the output might look something like this:
Code:host.domain.com 12.12.12.12 host123.domain.com 123.123.123.123 h.domain.com 21.21.21.21 blah.domain2.com 32.32.32.32 aaa.domain.com 111.111.111.111
while it displays the right information, the output of the program as you can see is uneven and looks generally sloppy. What I'd like to do is have it's output look more like:
so that even though the data that goes together (host -- ip) is printed horizontally, columns of the text are outputted evenly. Is this possible ? Thanks.Code:host.domain.com 12.12.12.12 host123.domain.com 123.123.123.123 h.domain.com 21.21.21.21 blah.domain2.com 32.32.32.32 aaa.domain.com 111.111.111.111
--EDIT--:
In the example of how I want the output to look it still came out uneven, I guess thanks to how the forum parses my thread. Trust me though, the first number in the first octect of each IP in my example all line up >_<