HI
I need to write a program that reads a paragraph from a file (i dont know its length) and i need to read it with spaces
i thought of using getline() function but there were problems:
1) how to detect End Of File
2) how to use getline while reading from file
and thought of reading one character at a time but it didnt read spaces
thanks, coder1
Quick and dirty…
1 2 3 4 5 6 7 8 9 10 11 12
|
std::string line, all;
while (fin.good())
{
getline(fin, line);
/* Manipulate `line' here... */
all += line;
}
fin.close();
|
Last edited on
Its not working blakek
Its not working DTScode
Last edited on
no im so sorry it is working there was a mistake by me.
so sorry