Search:
Forum
Beginners
Making a calculator program.
Making a calculator program.
Apr 16, 2014 at 2:29am UTC
mv81
(13)
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 UTC
LB
(13399)
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 UTC
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs