Can someone please help me understand the following expression?
printf("%3d - %s\n", counter, name)
This line prints something like this 6 - Install Adobe software
I looked through the information and read the link, but I can not find a simple answer, and I was a little confused. If you can refer me to a good link, please do so.
%3dWell, as far as I understand, %3dthis is the number of characters or spaces. Please provide me with a link that explains this.
%s\nI could not understand what this was doing. I guess this \nis a new line or something similar, but looking at the output, it doesn't seem to work.
Why are variables counterand nameseparated by commas?
If you look at the result, it seems that %3dis replaced by countera %s\nis replaced by name. I am not sure how this works, but I would like to understand this.
source
share