cProgHW4Part2 - printf("Terminating program....

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
C PROGRAMMING HOMEWORK 4 PART 2 /******************* Homework Assignment 4 Part 2 By: /******************/ #include <stdio.h> #include <stdlib.h> #include <string.h> #define INPUT_FILE "inputfile.in" #define OPUT_FILE "outputfile.out" typedef char *string; typedef char wordlist; int main() { FILE *infile; infile= fopen(INPUT_FILE, "r"); if (infile == NULL) { printf("Cannot open file!\n" INPUT_FILE);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: printf(&quot;Terminating program. ..\n&quot;); exit(1); } wordlist wordset[50][5]; int counter, inputvar; for (counter=0; counter&lt;10; counter++) //to fill array strings { wordlist store; fscanf(infile, &quot;%s&quot;, &amp;store); while (1==fscanf(infile, &quot;%i&quot;, &amp;store)); wordset[counter]=store; inputvar=counter; } system(&quot;PAUSE&quot;); return 0; }...
View Full Document

Ask a homework question - tutors are online