#include #include int readInput (FILE* input) { char line[300]; char word[101]; char delimit[10]; char filename[30]; FILE* f; char* pch; strcpy (delimit, " \t\n"); while ( fgets (line, 300, input) != NULL ) { pch = strtok (line, delimit); while (pch != NULL) { strcpy (word, pch); printf ("*%s*\n", word); if (strcmp (word, "q") == 0) return; if (strcmp (word, "f") == 0) { pch = strtok (NULL, delimit); strcpy (filename, pch); f = fopen(filename, "r"); if (f != NULL) { readInput (f); fclose(f); } } pch = strtok (NULL, delimit); } } } int init() { return 7; } void staticTest (int ctrl) { static int x = NULL; if (x == NULL) x = init(); x = x + 1; printf ("staticTest - x: %d, ctrl: %d\n", x, ctrl); if (ctrl > 0) staticTest (ctrl-1); } int main (int argc, char** argv) { staticTest(5); printf ("Between calls to staticTest() \n"); staticTest(3); readInput (stdin); }