cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
ASCII file as input
ASCII file as input
Mar 29, 2009 at 7:05pm UTC
Sycrupol
(14)
I need to use ASCII files as input to my program, and haven't got a clue about how can i do that (the program should read the file's location from keyboard). So how can i include an ASCII type file into the code? Thanks for all the help beforehand!
Mar 29, 2009 at 8:50pm UTC
firedraco
(6243)
Use an fstream. First, you can just get the location using getline(), and then pass it as the parameter of the fstream (or use .open()).
Mar 29, 2009 at 9:04pm UTC
Bazzy
(6281)
Here is a tutorial on input/output with files:
http://www.cplusplus.com/doc/tutorial/files.html
Topic archived. No new replies allowed.