how to ignore whitespaces in fscanf()

后端 未结 3 772
暖寄归人
暖寄归人 2021-01-18 08:33

I need to use fscanf to ignore all the white spaces and to not keep it. I tried to use something like the combination between (*) and [^\\n]<

3条回答
  •  旧巷少年郎
    2021-01-18 09:04

    Your code is crashing because you have a %s in your format specifier in the fscanf call, and you don't pass fscanf a char * to which you want it to write the string it finds.

    See http://www.cs.utah.edu/~zachary/isp/tutorials/io/io.html.

提交回复
热议问题