Character-by-character

The simplest Input-Output operations are performed at the character level using getchar() and putchar():
    int getchar(void)
and
    int putchar(int)

    #include <stdio.h>

    /* Copy standard input to standard output : */

    main() {

        int c;

        c = getchar();

        /* while not reached end-of-file on input : */
        while (c != EOF) {
            putchar(c);       /* ignore possible errors */
            c = getchar();
          }
      }


...previousup (conts)next...



About this document:

Produced from the SGML: /home/isd/public_html/_course_crash_in_c/_reml_grp/index.reml
On: 3/3/2003 at 17:43:41
Options: reml2 -i noindex -l long -o html -p multiple