Hi,
I need to read a file character by character and send it to cout at the same time.
I have used get(char) but cannot lose the newline character.
I'm quite new to C++ and havn't yet grasped the concept behind c-strings/strings.
Code so far..
while(in.get(n)) {
if (n=='\n') {
in.ignore();
}
cout << n << endl;
x++;
if(x==longest) {
x = 0;
y++;
}
}
The first line prints ok but the rest have 1st character missing.
Need help.
Thanks.