Reading one line at a time in C

后端 未结 10 874
萌比男神i
萌比男神i 2020-12-01 13:01

Which method can be used to read one line at a time from a file in C?

I am using the fgets function, but it\'s not working. It\'s reading the space

10条回答
  •  死守一世寂寞
    2020-12-01 13:40

    You can use fscanf instead of fgets. Because fgets fscanf for characters including spaces but while using fscanf you can separately access to data saved in a file.eg there be a file having name class roll.now declare a string and two integers line.

提交回复
热议问题