futzing with printf return

This commit is contained in:
Dan Buch 2011-06-19 07:45:12 -04:00
parent 803101b36f
commit b95730410b
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,15 @@
/**
* :author: Dan Buch (daniel.buch@gmail.com)
*/
#include <stdio.h>
int main()
{
int i = 43;
printf("%d\n", printf("%d", printf("%d", i)));
return 0;
}
/* vim:filetype=c:fileencoding=utf-8
*/

View File

@ -0,0 +1,17 @@
/**
* :author: Dan Buch (daniel.buch@gmail.com)
*/
#include <stdio.h>
int main()
{
int i = 43, nprinted;
nprinted = printf("%d\n", printf("%d", printf("%d", i)));
nprinted = printf("(the last one was %d characters)\n", nprinted);
nprinted = printf("(and that was %d characters)\n", nprinted);
return 0;
}
/* vim:filetype=c:fileencoding=utf-8
*/