Hello,
I am munipulating a text file for my c++ course.
The software replaces characters in a text file.
The only problem is that if I replace a number óf characters beginning with the first character in the file, the output gets distorted.
In the textfile
123456789012345678901234567890
123456789012345678901234567890
123456789012345678901234567890
gets changed to (The * stands for a space)
**********12345678901234567890
123456789012345678901234567890
123456789012345678901234567890
but on the console the thing is shown as
12345678901234567890
123456789012345678901234567890
123456789012345678901234567890
this is the function to read the file to the screen:
1 2 3 4 5 6 7 8 9 10 11 12
|
void Daten::lesen()
{
ifstream MyIfstream(DateiName);
char ch;
MyIfstream >> ch;
while (!MyIfstream.eof())
{
cout << ch;
ch = MyIfstream.get();
};
};
|
Why do I not get the 10 spaces printed to the console?
int main