C/Console/Console Output — различия между версиями
Admin (обсуждение | вклад) м (1 версия: Импорт контента...) |
|
(нет различий)
|
Версия 17:20, 25 мая 2010
Check how many char have been outputed from printf
<source lang="cpp">
- include <stdio.h>
int main(void) {
int i; printf("%d %f\n%n", 100, 123.23, &i); printf("%d characters output so far", i); return 0;
}
</source>
Flush a stream: how to use fflush
<source lang="cpp">
- include <stdio.h>
int main() {
char string[80]; printf( "Enter a string: " ); scanf( "%s", string ); printf( "The string you entered is : %s\n", string ); fflush ( stdin ); return 0;
}
</source>