eof()的哪个头文件
答
You'don't更好地参考以下主题:How does ifstream's eof() work?
在C语言中,你应该包括stdio.h并使用EOF常量。
#include "stdio.h"
....
if (getc()==EOF){...}
或使用C++这个参考:cstdio
#include <cstdio>
#include <iostream>
...
if(infile.peek()==infile.eof())
不要你的意思infile.eof()? –
有没有什么方法可以提前偷看2个角色而不会得到角色。 – Alex
设置infile.peek()== infile.eof()不起作用。如何检查文件结尾的最后一个字符? – Alex