July 2015
Intermediate to advanced
380 pages
10h 15m
English
You’ve been using printf to print things, and that’s great and all, but you need more. In this exercise, you’ll be using the functions fscanf and fgets to build information about a person in a structure. After this simple introduction about reading input, you’ll get a full list of the functions that C has for I/O. Some of these you’ve already seen and used, so this will be another memorization exercise.
ex24.c
1 #include <stdio.h> 2 #include "dbg.h" 3 4 #define MAX_DATA 100 5 6 typedef enum EyeColor { 7 BLUE_EYES, GREEN_EYES, BROWN_EYES, 8 BLACK_EYES, OTHER_EYES 9 } EyeColor; 10 11 const char *EYE_COLOR_NAMES[] = { 12 "Blue",