ignore extra spaces when using fgets

Posted by Gary on Stack Overflow See other posts from Stack Overflow or by Gary
Published on 2010-03-20T04:07:41Z Indexed on 2010/03/20 4:11 UTC
Read the original article Hit count: 352

Filed under:
|

Hi,

I'm using fgets with stdin to read in some data, with the max length i read in being 25. With one of the tests I'm running on this code, there are a few hundred spaces after the data that I want - which causes the program to fail.

Can someone advise me as to how to ignore all of these extra spaces when using fgets and go to the next line?

Thanks

© Stack Overflow or respective owner

Related posts about c

    Related posts about fgets