Vc 中写 getch(); 
为什么无效?

解决方案 »

  1.   

    同意楼上~~~
    或者用system("pause");
      

  2.   

    但是用system("pause");要添加头文件windows.h~~~
    还有要想用getch(),这个不行~~
    但是可以用_getch();
    C Run-Time的函数~~~
    具体可以参考~~~
    #include <conio.h>
    #include <ctype.h>int main( void )
    {
       int ch;   _cputs( "Type 'Y' when finished typing keys: " );
       do
       {
          ch = _getch();
          ch = toupper( ch );
       } while( ch != 'Y' );   _putch( ch );
       _putch( '\r' );    /* Carriage return */
       _putch( '\n' );    /* Line feed       */
    }