fgets instructions gets skipped.Why?

Posted by nunos on Stack Overflow See other posts from Stack Overflow or by nunos
Published on 2010-05-25T17:44:25Z Indexed on 2010/05/25 18:01 UTC
Read the original article Hit count: 157

Filed under:
|
|

Whenever I do a scanf before a fgets the fgets instruction gets skipped. I have come accross this issue in C++ and I remember I had to had some instrcution that would clear the stdin buffer or something like that. I suppose there's an equivalent for C. What is it?

Thanks.

© Stack Overflow or respective owner

Related posts about c

    Related posts about scanf