futzing with printf return
This commit is contained in:
parent
803101b36f
commit
b95730410b
15
gowrikumar/src/10-nestedprintf.c
Normal file
15
gowrikumar/src/10-nestedprintf.c
Normal 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
|
||||||
|
*/
|
17
gowrikumar/src/10b-nestedprintf.c
Normal file
17
gowrikumar/src/10b-nestedprintf.c
Normal 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
|
||||||
|
*/
|
Loading…
Reference in New Issue
Block a user