There is no such problem here:
C:\Temp> cl Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
EDIT: Additional Information
I tested this by compiling the program you published. I created a file consisting of 0123456789, repeating 100,000 times (whose size is 1,000,000 bytes). Then i ran
C:\Temp> t.exe < test.in
and
C:\Temp> cat test.in | t.exe
and
C:\Temp> t.exe < test.in > test.out
There were no problems. It took quite a while to wait for 1,000,000 characters to pass through.
source share