c++中EOF was not in this scope 的解决办法

来源:互联网 发布:nginx 反向代理百度 编辑:程序博客网 时间:2024/05/13 19:03

在该c++文件的前面加上 #include <cstdio>即可

#include <iostream>#include <cstdio>using namespace std;int main(){    char ch;    int count = 0;    cout << "Enter characters:" << endl;    ch = cin.get();    while(ch != EOF)    {        cout.put(ch);        count++;        ch = cin.get();    }    cout << count << " characters read!" << endl;    return 0;}


0 0
原创粉丝点击