box-o-sand/lcthw-remnants/ex24_iofunctions01.c
Dan Buch f2380eef05 Add 'lcthw-remnants/' from commit 'e172f73c8297b22a579c94558f0c171ca74a0e5c'
git-subtree-dir: lcthw-remnants
git-subtree-mainline: 4107485591
git-subtree-split: e172f73c82
2013-01-09 23:42:19 -05:00

20 lines
363 B
C

#include <stdio.h>
#include "dbg.h"
int main(int argc, char *argv[])
{
int a, b, rc;
char c;
printf("Reading from stdin: <a:number> <b:number> <c:letter>\n> ");
rc = fscanf(stdin, "%d %d %c", &a, &b, &c);
check(rc == 3, "Failed to read from stdin.");
printf("Read in: a=%d b=%d c=%c\n", a, b, c);
return 0;
error:
return 1;
}