codescracker


c

C fscanf()



« Previous Function Next Function »


fscanf()

The fscanf() function works exactly like scanf() function except that it reads informations from the stream specified by stream instead of the stdin

fscanf() Syntax

#include<stdio.h>
int fscanf(FILE *stream, const char *format, ...);

The fscanf() function returns number of arguments actually assigned values. This number does not include skipped fields. A returned value of EOF means, a failure occurred before first assignment was made.

fscanf() Example

Following c code reads a string and a float from the stream fp:

char str[80];
float f;
fscanf(fp, "%s%f", str, &f);

« Previous Function Next Function »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test