Sunday 9 July 2017

Getchar

Getchar Function

Getchar takes input a character from standard input (stdin) and return integer value without sign.

int main(void)
{
   int c;

   /* Note that getchar reads from stdin and

      is line buffered; this means it will
      not return until you press ENTER. */

   while ((c = getchar()) != '\n')
      printf("%c", c);

   return 0;

}

No comments:

Post a Comment