- C Programming Basics
- C Tutorial
- C Program Structure
- C Basic Syntax
- C Data Types
- C Constants
- C Variables
- C Operators
- C Ternary Operator
- C Storage Classes
- C Flow of Control
- C Decision Making
- C if if-else Statement
- C switch Statement
- C Loops
- C for Loop
- C while Loop
- C do-while Loop
- C goto Statement
- C break Statement
- C continue Statement
- C Popular Topics
- C Arrays
- C Strings
- C Pointers
- C Functions
- C Recursion
- C Scope Rules
- C Programming Advance
- C Structures
- C Unions
- C Bit Fields
- C Enumerations
- C Input & Output
- C Typedef
- C Preprocessors
- C Type Casting
- C Recursion
- C Error Handling
- C Linked Lists
- C Stacks
- C Queues
- C Binary Trees
- C Header Files
- C File I/O
- C Variable Arguments
- C Memory Management
- C Command Line Arguments
- C Programming Examples
- C Programming Examples
- C Programming Test
- C Programming Test
C 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 »
Follow/Like Us on Facebook
Subscribe Us on YouTube