0
file names (SOS)!
i want to import a file name in my hard disc and assign it to string in my program, how can i do it?
1 Answer
+ 7
string myText;
// Read from the text file
ifstream MyReadFile("filename.txt");
while (getline (MyReadFile, myText)) {
  // Output the text from the file
  cout << myText;
}
You must include fstream lib