CS 211 - 4/26/13 Exam 2 in Lab on Tuesday 4/30/13 Same format at Exam 1 You will have full access to your programs, the internet, etc. Multiple source code files was part of last semesters Exam 2. (this would include the use of a make file) Look for email regarding next Friday void readIn (FILE *fp) { int val1; char ch1; char ch2; char input[30]; char fname[30]; FILE *fp1; while (!feof(fp)) { fscanf (fp, "%c", &ch1); // process input if (ch1 == 'q') exit(0); if (ch1 == 'f') { fgets (input, 30, fp); /* remove \n from end of fname */ sscanf (input, "%s\n", fname); fp1 = fopen (fname, "r"); /* if fname is not in the List of strings */ /* { */ /* add fname to the list of strings */ / * readin (fp1); */ /* remove fname from the list of strings */ /* } */ if (fp == stdin) /* as required by pp13 */ readIn (fp1); } if (ch1 != 'f') do { fscanf (fp, "%c", &ch2) } while (ch2 != '\n'); } /* remove fp from the list of FILE* */ } void main() { readIn (stdin);