最佳答案
我尝试使用 C + + 从 stdin 读取代码
#include <iostream>
using namespace std;
int main() {
while(cin) {
getline(cin, input_line);
cout << input_line << endl;
};
return 0;
}
当我编译时,我得到这个错误. 。
[root@proxy-001 krisdigitx]# g++ -o capture -O3 capture.cpp
capture.cpp: In function âint main()â:
capture.cpp:6: error: âinput_lineâ was not declared in this scope
知道少了什么吗?