cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
How to open a file .txt that the user in
How to open a file .txt that the user input in ifstream
Sep 9, 2013 at 8:04pm UTC
Bleedz129
(57)
How to open a file that the user input
1
2
3
4
ifstream InFile; ofstream OutFile; InFile.open(
"???.txt"
)
Sep 9, 2013 at 8:06pm UTC
LB
(13399)
Ask the user for the filename, use std::getline to put it into a std::string, and then use that as the filename.
Sep 9, 2013 at 8:08pm UTC
Bleedz129
(57)
Can u write it more clearly in codes ?
Sep 9, 2013 at 8:08pm UTC
Mats
(1398)
Read about string and getline and then you can do it...
Topic archived. No new replies allowed.