Error in reading a text file

this text file contains 2 paths separated by space:
/home/alex/Documents/my\ current\ projects/megauploader.zip /home/alex/Documents/my\ current\ projects/pcnamechanger.tar.gz
[as known, in every path, to access it, if it has spaces you need to put a \ before the space]
I use this method to read the file:
1
2
3
4
5
6
     if (myReadFile.is_open()) {
     while (!myReadFile.eof()) {
        myReadFile >> output;
        cout << output << "   <--- This is what the file contains!\n";
     }
    }

So, when I run this code, I get as output:
1
2
3
4
5
6
7
8
9
10
/home/alex/Documents/my\ 

current\   <--- This is what the file contains

projects/megauploader.zip   <--- This is what the file contains

/home/alex/Documents/my\   <--- This is what the file contains

current\   <--- This is what the file contains

projects/pcnamechanger.tar.gz   <--- This is what the file contains

and not the whole output. How can I have the whole file and not just the projects/pcnamechanger.tar.gz as this is the last value of output variable????
Last edited on
Ammm never mind, I used Getline instead.
Topic archived. No new replies allowed.