Hi friends, first of all I would like to apologize for my bad English ... it's not my mother tongue and I'm using an online translator.
I have some code that can read and write to a txt file and move the words into string variables.
if the file is on my computer, it works. but if the file was on the internet, how could I do?
(for example http://www.mysite.com/file.txt)
#include <iostream>
#include <fstream>
usingnamespace std;
int main() {
char x[10];
char y[10];
fstream filei;
fstream fileo;
filei.open("file.txt");
if(!filei) {
cout << "error in reading the file";
return 1;
}
filei >> x >> y;
filei.close();
cout <<"the first word is: "<< x <<endl;
cout <<"the second word is: "<< y <<endl;
return 0;
}
I forgot to tell you, yes I use windows.
before asking for help to you I tried a lot, and I found a lot of information but probably I'm not good enough to use them ....
would it be very complicated to give me an example ready to be used? I do not know how you can solve ...