69,373
社区成员
发帖
与我相关
我的任务
分享
/* SETMODE.C: This program uses _setmode to change
* stdin from text mode to binary mode.
*/
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
void main( void )
{
int result;
/* Set "stdout" to have binary mode: */
result = _setmode( _fileno( stdout ), _O_BINARY );
if( result == -1 )
perror( "Cannot set stdout to have binary mode!" );
else {
printf( "'stdout' successfully changed to binary mode\n" );
printf("%c",0x0a);
}
}