Can fscanf() read whitespace?

后端 未结 6 1828
野趣味
野趣味 2020-12-09 00:29

I\'ve already got some code to read a text file using fscanf(), and now I need it modified so that fields that were previously whitespace-free need to allow whi

6条回答
  •  时光取名叫无心
    2020-12-09 01:21

    I highly suggest you stop using fscanf() and start using fgets() (which reads a whole line) and then parse the line that has been read.

    This will allow you considerably more freedom in regards to parsing non-exactly-formatted input.

提交回复
热议问题