what is the use of fflush(stdin)in c language

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions.

A community for students.

what is the use of fflush(stdin)in c language

Computer Science
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

I believe it flushes the input stream (meaning, clears it out). It is implemented as sometimes invisible characters (new lines/line breaks) get stuck in there. There are other ways to handle these characters without flushes.
fflush(stdout) is very useful for making sure that all buffered output has been flushed out (usually to a disk file or the terminal). If you don't use it, then Odd Things can happen (for instance, a prompt appearing *after* you do the corresponding read from the terminal, or the last bit of output from the program never actually making it into a disk file). Since fflush() is only defined for "output" streams, it's a good way to generate an EBADF (bad file descriptor) for calling it on a non-output stream.

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Not the answer you are looking for?

Search for more explanations.

Ask your own question