[try Beta version]
Not logged in

 
Making a calculator program.

Apr 16, 2014 at 2:29am
So i was wondering if their is a way that you can make your program read a file and read all the numbers in the file and plug it in your formula. And output the answers.(any related articles that you can point me towards would be appreciated.)
Apr 16, 2014 at 2:32am
http://www.cplusplus.com/doc/tutorial/files/

You will want a simple input loop:
1
2
3
4
5
6
7
8
{
    int x;
    std::ifstream in ("input.txt");
    while(in >> x)
    {
        //do calculation
    }
}
The outermost braces are intentional.
Last edited on Apr 16, 2014 at 2:32am
Topic archived. No new replies allowed.