#include <iostream>
#include <cstdlib>
#include <string>
#include <conio.h>
#include <fstream>
using namespace std;
int main() {
char input;
while (true) {
input = _getch();
cout << "The input is: " << input << "\n";
}
ifstream level1;
level1.open("level1.txt");
string str[255];
while (true) {
getline(level1 , str);
cout << str;
}
system("PAUSE");
}
错误即时得到:函数getline错误,阅读每一行
没有没有重载函数“函数getline”的实例参数列表
什么即时试图做的是真正的每一行相匹配在文本文件中
为什么你需要255个字符串的声明? – Rakete1111
@ Rakete1111我不要,但它只是检查 – guy
@Galik现在正在做它 – guy