What is the difference between fscanf and fgetc? I have a few people arguing with me on the differences. I thought fgetc reads character by character of a file. I thought fscanf reads the whole file. Is that corrrect? Can someone elaborate on what I forgot?
COKEDUDE
27
Junior Poster in Training
Recommended Answers
Jump to PostHow the hell would we know what you forgot?
Jump to PostIs that corrrect?
Not at all. Have you checked a C reference manual? The only similarities
fgetc
andfscanf
have is they read input from a stream, and fscanf can simulatefgetc
.The people you were arguing with, what were their points? Perhaps we can clear up any …
All 7 Replies
gerard4143
371
Nearly a Posting Maven
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
COKEDUDE
27
Junior Poster in Training
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
COKEDUDE
27
Junior Poster in Training
gerard4143
371
Nearly a Posting Maven
COKEDUDE
27
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.