Question: Please help!! This ask is simpler than it looks, the end result just has to follow the conditions given. Please code this in C (NOT
Please help!! This ask is simpler than it looks, the end result just has to follow the conditions given. Please code this in C (NOT C++). Please DO NOT write out by hand so I can test/manipulate the code. Feel free to ask any questions you might have. I have a dictionary.txt file already, the code just needs to be able to read it in the way given.
Thanks!!!!
Assume the string.h file going into this contains just the following so far:
MY_STRING my_string_init_default(void);
MY_STRING my_string_init_c_string(const char* c_string);
int my_string_get_capacity(MY_STRING hMy_string);
int my_string_get_size(MY_STRING hMy_string);
int my_string_compare(MY_STRING hLeft_string, MY_STRING hRight_string);
=========================================================================================



In order.to begin to build a Hangman game we need a dictionary of words. Last week you began to build a string opaque object that will help with this task. This week we will continue adding features to the string object to allow us to read and write words from a dictionary Add the following declarations to your string.b header file and remember to include stdio.h near the top of the file //Precondition: bMvstring is the handle to a valid My string object. Postcondition: bMstring will be the handle of a string object that contains // the next string from the file stream fp according to the following rules. // 1) Leading whitespace will be ignored // 2) All characters (after the first non-whitespace character is obtained // and included) will be added to the string until a stopping condition // is met. The capacity of the string will continue to grow as needed until all characters are stored // 3) A stopping condition is met if we read a whitespace character after / we have read at least one non-whitespace character or if we reach // the end of the file // Function will return SUCCESS if a non-empty string is read successfully // and failure otherwise. Remember that the incoming string may aleady // contain some data and this function should replace the data but not // necessarily resize the array unless needed Status my string.extractign(MY_STRING bMy string, FILE* fp); //Precondition: bMv string is the handle to a valid Mx string object. //Postcondition: Writes the characters contained in the string object indicated // by the handle bMy string to the file stream fp / Function will return SUCCESS if it successfully writes the string and // FAILURE otherwise Status y stringinsertion(MY_STRING bMy string, FILE* fp) In addition to following the pre and post-conditions above you need to follow one additional rule for the extraction function. If you read a string from a file stream and then stop on a whitespace then that whitespace character that you stopped on should be readable by the next file operation. As an example, suppose that the file simple.txt" contains the sentence: "The quick brown fox jumped over the lazy dogs." with no spaces or newlines after the period. Consider the following driver program
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
