p1-96.cpp

来自「c++200源代码」· C++ 代码 · 共 22 行

CPP
22
字号
#include <stdio.h>
void main( void )
{
    int c;
    /* Create an error by writing to standard input. */
    putc( 'A', stdin );
    if( ferror( stdin ) )
    {
      perror( "Write error" );
      clearerr( stdin );
    }

    /* See if read causes an error. */
    printf( "Will input cause an error? " );
    c = getc( stdin );
    if( ferror( stdin ) )
    {
       perror( "Read error" );
       clearerr( stdin );
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?