imported_vr6
Platinum Member
i am trying to read in a string from a .dat file into a sting into my program.
Here is what the data file contains. "It was a very very sunny day on the fifth day of november"
I have already opened the file and it is called "inFile" and the string is called "string"
so at first i simply did this.
inFile >> string
when i printed the results, i simple got "It"
how do i go about putting that into a loop?
i tried to use EOF but since i am dealing with chars and EOF returns a int, i am not able to use it?
so how do i go about storing the whole sentence into "string"?
Here is what the data file contains. "It was a very very sunny day on the fifth day of november"
I have already opened the file and it is called "inFile" and the string is called "string"
so at first i simply did this.
inFile >> string
when i printed the results, i simple got "It"
how do i go about putting that into a loop?
i tried to use EOF but since i am dealing with chars and EOF returns a int, i am not able to use it?
so how do i go about storing the whole sentence into "string"?