getchar.c

来自「8051试验程序 基础教材」· C语言 代码 · 共 29 行

C
29
字号
/*                      - GETCHAR.C -

  The ANSI "getchar" function delivered here is supposed to be tailored
  for the actual target hardware.  This version of getchar contains a simple
  line-editor that can back-space and delete  (In_DELETE), skip line and
  start over again (In_SKIP), as well as recognize end of file (In_EOF).

  $Name: V7_dot_30A $

   Copyright 1986 - 1999 IAR Systems. All rights reserved.
*/

#include "stdio.h"
#include "ioADUC843.h"

int getchar(void)
{

  char c;

  while (!SCON_bit.RI);
  c = SBUF;
  SCON_bit.RI = 0;
  return (c);


}

⌨️ 快捷键说明

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