Question: Please write in C++ and briefly explain. Question 1 Write a ReadCorrectWords function to store all known, correct words for your spellchecker. It should have
Please write in C++ and briefly explain.


Question 1 Write a ReadCorrectWords function to store all known, correct words for your spellchecker. It should have the following parameters in the order provided a string filename an array of strings correctWords[] the size of the array an integer startlndex. Your function should return the total number of correct words in the array correctWords. Your function should open the file identified by filename and read lines from the file line by line. The file will have the following format: correctWords.txt chicken fish COW bubbles pear kiwi You can expect exactly one word on each line. Each word is a correct spelling and should be added to the correctWords array. The parameter startlndex is the index at which you should begin adding your words in the array. If I called your function with the file above and startlndex- 0, your correctWords array should look like this: ["chicken", "fish" "cow", "bubbles", "pear", "kiwi"] Your function should return 6 (for 6 words total in the array)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
