Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我当前的 C 语言项目中,我必须从文件 2 int 中读取并确保在这些文件之后有一个换行符。我正在尝试使用 fscanf 函数 (fscanf(f,"%d %d",&a,&b)),但是这样我不知道它们是否在同一行或者后面是否有换行符。
有什么想法吗?
用于fgets()将一整行读入缓冲区,然后检查您读取的行,也许通过sscanf()解析出两个整数。
fgets()
sscanf()