I am wondering if I have an input file with multiple lines and each line needs to have an output (multi-line output) from a function, how would the input/output coding work?
For instance if I had a program that calculates mathematical expressions (stored as strings), how would I input multiple lines, each with a different math expression, from stdin so that the output(s) calculate(s) every input expression (outputs multiple answers)?
std::string line;
while(std::getline(std::cin, line)) {
if (line == "stop")
break; //Additional way to stop input
//I assume, your calculations are done in eval() functions which takes string argument
std::cout << eval(line);
}