Posted this yesterday,worked on the code and need some clues on this. Meanwhile i have my text file saved up somewhere else in notepad.
The program is to parse a text file into words and count the number of occurrences of each word.Then it is to sort and print the list after it has been built.
here is my code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <string.h>
#include <stdio.h>
FILE *input_file_pointer;
void main (void)
{
char word [100];
printf("\n we will split the file parse.c into words");
input_file_pointer = fopen("parse.c", "r");
while( fscanf( input_file_pointer, " %s",word)!=EOF)
{
printf(" (%s)",word);
}
Is this a C assignment or C++? Please clarify. If it is c++, you are off to a rough start. Even if it is C, I don't think it is a fair question. You've barely begun! In fact you didn't even both to post something that compiles. Where is the closing bracket for the main function? You are asking for clues but not asking questions about any of the specific parts of the assignment. That tells me that you are just looking for someone to finish it for you.