file names (SOS)! | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
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?

30th Jan 2020, 1:32 AM
Max
Max - avatar
1 ответ
+ 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
30th Jan 2020, 1:47 AM
Jobelle
Jobelle - avatar