getch()函数等待按键

getch()不会将字符回显到屏幕上。getche()函数与getch()相同,但键是回显的。

#include <stdio.h>
#include <conio.h>
#include <ctype.h>

int main(void)
{
   char ch;

   printf(Enter some text (type a period to quit).\n);
   do {
      ch = getch();

      if (islower(ch)) ch = toupper(ch);
      else ch = tolower(ch);

      putchar(ch);
   } while (ch != '.');
   return 0;
}

相关文章

for遍历数组
。。。
声明一个计数循环
咕咕咕
#include <stdio.h> int main (void) { printf (&quo...