char buf[10];
int counter, x = 0;
snprintf (buf, sizeof buf , "%.100d%n", x, &counter);
printf("Counter: %d\n", counter)
I am learning about precision with printf. With %.100d%n, the precision here gives 100 digits for rendering x.
What I don't understand is why would the counter be incremented to 100, although only 10 characters are actually written to the buffer?