+ 1

How to add external file from pc in c++ code to use in programme?

i need this to have access of file from my pc during i am using my programme

7th Jan 2017, 7:54 AM
navdeep dhakar
navdeep dhakar - avatar
2 odpowiedzi
+ 2
use the std::fstream. int main () { std::fstream mystream; mystream.open ("file.txt", std::ifstream::in); } that code simply opens a text file on your pc. you can use fstream to read and write on files
7th Jan 2017, 9:25 AM
Brendan Rovholo
Brendan Rovholo - avatar
+ 2
thanks brendan it really works and now i am coding awesome programme it is very helpul
7th Jan 2017, 12:08 PM
navdeep dhakar
navdeep dhakar - avatar