on-internet
← Community

Why Bionic C runtime library in Android does not support "%n" format in printf function?

Stack Overflow ·

According to ISO C standard (ISO/IEC 9899), printf function contains "%n" format to count the number of output characters. n: The argument shall be a pointer to signed integer into which is written the number of characters written to the output stream so far by this call to fprintf. No argument is converted, but one is consumed. If the conversion specification includes any flags, a field width, or a precision, the behavior is undefined. Example code: #include <stdio.h> int main (void) { int c1, c2; printf ("hello%n, world%n\n", &c1, &c2); printf ("% d\t% d\n", c1, c2); return 0; } The C runtim

Comments

Sign in or sign up to comment and upvote.

No comments yet.