a b c d
e f g h i
j k l
and I have a char variable a:
char a;
Now suppose I read each letter and do something with it, such as converting it to a number. The desired output in a new file should be:
1 2 3 4
5 6 7 8 9
10 11 12
Don't pay attention to the numbers, but rather the format of the output (3 lines).
My problem is: I don't know how to read the newline character correctly. I've already tried
File >> a;
if (a == '\n')
Out << '\n';
That would create a new line in the output file. But for some reason it just doesnt work and the output is the following:
1 2 3 4 5 6 7 8 9 10 11 12
No formatting. Anyone has suggestions on how to create that newline?