I'm trying to print text to an output file, and I need my output file to match the proper formatting exactly.
I need to do this so that when my program's output is compared to what the proper output should be, (talking large output files here) a simple string comparison of the output files should flag them as perfectly identical.
Here is an example of the EXACT expected output:
| Item 1234 | CALCULATOR | $ 0.45 |
| Item 5678 | USA_FLAG | $ 10.99 |
| Item 9012 | WITCH_BROOM | $ 18.00 |
Notice how with this formatting there are variable amounts of spaces after each string and before the double numbers, but they still manage to line up perfectly. So how do you output this kind of formatting?
I'm assuming there is something about fprintf() that I just don't know, but again, I don't know soooooooooooooo