Expand|Select|Wrap|Line Numbers
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #define FILENAME 80
- #define MAX_SIZE 1000
- #define CHAR_SIZE 200
- #define FLUSH while(getchar() != '\n')
- // Prototype Declarations
- int getFileName (char nameStr[]);
- int parseInput( char tempStr[], struct WORD_STRUCT structAry[]);
- int main (void)
- {
- // Local Definitions
- FILE *inFile;
- int numElems;
- int nameSize;
- int i;
- char nameStr [FILENAME];
- char originalStr[MAX_SIZE];
- char tempStr[MAX_SIZE];
- char *pArray [CHAR_SIZE];
- typedef struct {
- char *word;
- int count;
- } WORD_STRUCT;
- typedef struct nodeStruct {
- WORD_STRUCT data; /* can be any type */
- struct nodeStruct *next; /* points to the next
- node */
- } NODE;
- WORD_STRUCT structAry[CHAR_SIZE];
- // Statements
- printf("Beginning of Program.\n");
- if (!(inFile = fopen (nameStr, "r")))
- {
- printf("Error opening %s for reading\n", nameStr);// Prints Error if cannot find file
- exit (100); // Quit if cannot find file
- } // if open input
- while(fgets ( tempStr , MAX_SIZE , inFile)!=NULL);
- {
- parseInput(tempStr, structAry); // This is where I am getting the ERROR
- }
- return 0;
- }