我想要做的是输入一行字符然后对其执行操作将其保存到一个输出文件位置然后读取下一行并做同样的事情。
//seperate function called within int main.
//expression is passed by reference to this function.
ifstream infile;
int i = 0;
infile.open("test.data");
if(infile.fail()){
cout << "ERROR: File failed to open." << endl;
exit(1);
}
while(!infile.eof()){
infile >> expression[i];
while(expression[i +1] != '\o'){
infile >> expression[i + 1];
i++;
}
//perform other operations within a class
//print out results
//read next line from file.
谢谢你。我只需要帮助阅读文件中的下一行。可能在逻辑上并不完全正确,只是正在发生的事情的一个粗略例子。