file names (SOS)! | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
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 Respuesta
+ 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