exemple trouvé dans MSDN :
#include <stdio.h>
FILE *stream;
void main( void )
{
ss long l;
ss float fp;
ss char s[81];
ss char c;
ss stream = fopen( "fscanf.out", "w+" );
ss if( stream == NULL )
ssssssprintf( "The file fscanf.out was not opened
" );
ss else
ss {
ssssssfprintf( stream, "%s %ld %f%c", "a-string",ss
ssssssssssssss 65000, 3.14159, 'x' );
ssssss/* Set pointer to beginning of file: */
ssssssfseek( stream, 0L, SEEK_SET );
ssssss/* Read data back from file: */
ssssssfscanf( stream, "%s", s );
ssssssfscanf( stream, "%ld", &l );
ssssssfscanf( stream, "%f", &fp );
ssssssfscanf( stream, "%c", &c );
ssssss/* Output data read: */
ssssssprintf( "%s
", s );
ssssssprintf( "%ld
", l );
ssssssprintf( "%f
", fp );
ssssssprintf( "%c
", c );
ssssssfclose( stream );
ss }
}