Ok started over with my code. First trying to make it easier to read.
Second was hard to read so I goot confused. Now I am trying to separate my project into proper function calls. I need my program to read the file, then parse it into separte words. Max number of words is a 100 and not repeat any word. I have started but am stuck.
Can't get past my fuction call for initialize. What am I missing please help.
#define FLUSH while (getchar() !='\n')
#define STR_LEN 81
void initialize(int* index, char strng);
// Local Declarations
int size = 100;
printf("Data to Manipulate: \n\n");
if (!(spIn = fopen ("c:\\sample.txt", "r")))
printf("\aError could not open.\n");
while (fgets (strng, sizeof (strng), spIn))
//Allocate array in heap.
pWords = (char **)calloc (size, sizeof *pWords);
int index = 0;
fgets(strng, sizeof (strng), spIn);
sscanf(spIn, "%16[^'EOF']%4d", *(strng), &index);
Build the table for the string of characters.
Pre- file in
Post words counted
void initialize(int* index, char strng)
//pWords = 0;
for(j = 0; j < 100; j++)
printf("%4d = *strng[j]", j, *strng);