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 PostOne small subtle point.
fgetc() reads the next character from stream and returns it as an unsigned char cast to an int, or EOF on end of file or error.
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.