i need an explaination for fflush(stdin) what does it flush out? why does this happen
fflush(stdin) vs gets look into here http://c-faq.com/stdio/gets_flush2.html http://www.gidnetwork.com/b-57.html
fflush flushes everything from the buffer, in this case for stdin. so if you have read some data but there is more buffered still it will clear it.
but if it is used only when we use int and char simultaneously but when we use int and float do we use it?i dont think so...
fflish(stdin) =>clears the input buffer and it doesn't know it is int,char,float,double.It just flushes buffer.
my point is that we regularly use fflush(stdin) when we want to read int and char simultaneously but when we read int and float we don use it y??
Join our real-time social learning platform and learn together with your friends!