4 ms·
At that point, you will need to split your printf into pieces, so why not just use printf's return code, which tells you the number of characters written? Supp
by userbinator 9y ago
At that point, you will need to split your printf into pieces, so why not just use printf's return code, which tells you the number of characters written?
Suppose you are aligning subsequent output lines to the current line, and want to know the number of characters at certain points in the string. In fact this is probably the exact use-case for %.* and %n used together.