Topics -- That's Visual Studio C++ but it is not .NET.
Two programs that I have written recently die deep in Microsoft code when sent either a single character(as in fputc( ' ', fpOut ); or a string as in fprintf( fpOut, "abcd\n" ) ;
I have written over the years at least 500 programs that use the same methods. This fault is new.
The include files and all references to fpOut within a function are included in the attached file. The problem occurs when fpOut->_ptr points near or at the end of the 4096 byte buffer and fpOut->_cnt approaches or reaches zero. Other fpOut-> values are _flag = 10, _file = 4, _charbuf = 0, and of course _bufsiz = 4096.
I attempted an fflush as the end of the buffer was approached:
if( fpOut->_cnt < 64 ) fflush( fpOut ) ;
That did not work. fpOut.txt
The program disappeared into the depths of Microsoft's code. The program is left hanging. The task manager reports that it is using no cycles during this time. The program has to be terminated by the task manager