Witam, proszę o pomoc. Napisałem funkcję w c++ i nie działa. Problem jest głównie w lini "string line[lines];"
void fileRead(string filename, int lines) {
fstream file;
file.open(filename, ios::in);
if (file.good() == false) {
cout << "File is broken or missing!";
}
else {
string line[lines];
int lineNum = 1;
for (int i = 1; i <= lines; i++) {
while (getline(file, line)) {
lines[i] = line;
}
lineNum++;
}
}
}