Question: Pleasee help with C, not C++! I have asked for help 3 times and still not getting it right Follow instructions, and please please do
Pleasee help with C, not C++!
I have asked for help 3 times and still not getting it right
Follow instructions, and please please do not copy other answers! and see the sample output and all the requirments or used of structures...
Many Thanks

1. (100 pts) Write a program to find the frequency of words in a file. You need to use dynamic memory allocation for this assignment. Use array of pointers to store the words and frequencies. Set array size to 1000 and initialize all the pointers to NULL. Structure declaration to store words and frequencies is as follows struct word freq int count; char *word; When you see a word for the first time, insert into the array with count 1. If the word read from file is already in the array, increase its count. In this structure, you need to dynamically allocate the space for each word using malloc0. Use argc and argv for input file and output file. Sample execution of the program is given below. words tart is the input file which contains one word per line. frequencies.trt is the file to be generated by your program. It contains frequencies and words, one word and its frequency per line. elko5> assign6 words. txt frequencies. t Sample input file is given below apple orange apple banana orange orange Output file for above input is given below apple 2 3 orange 1 banana Don't forget to deallocate all the space allocated using malloc0 and calloc() using free0 function. Run your program under valgrind as shown below to verify that you have no memory leaks. elk 05> valgrind assign6 words .txt frequencies .txt Somewhere in the output it should say All heap blocks are freed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
