Multiple line input... Multiple line output

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?

Thanks
Can you elaborate. I'm not sure I understand what you want.
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)?
1
2
3
4
5
6
7
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);
}
Last edited on
Topic archived. No new replies allowed.