Use get() to read one character at a time: char c; file.get(c);. Unlike >>, this reads whitespace characters including spaces, tabs, and newlines. You see the file exactly as stored.
Loop pattern: while(file.get(c)) { process(c); }. This works for parsing custom formats, counting characters, or encrypting files. Each iteration gives you one byte from the file. For performance, prefer getline() or >> when possible, they buffer reads.
Character-by-character is slower but necessary for precise control over parsing or binary format detection.