#Homework make my own fgetc function (need help for last test !!!)

9 messages · Page 1 of 1 (latest)

icy wigeonBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

fossil wave
#

And this is my homework trace :

#

As you can see I pass 9 tests on 10, apparently my function doesn't work well for short file with EOF, any idea on what could be wrong with my function ?

sudden apex
#

i don't know much what's happening here but you're not checking for EOF anywhere are you

fossil wave
#

so when I check res == 0 it's checking EOF right

#

This is function prototype btw ** Reads a new character from the stream's buffer. ** If the buffer it empty, it should be refilled. ** Works just like fgetc(3). May set the error indicator. */ int lbs_fgetc(struct stream *stream);

icy wigeonBOT
#

@fossil wave

Please Do Not Delete Posts!

Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. You can use !solved to close a post and mark it as solved.

fossil wave
#

!solved