Write a C++ void Function names LocateWord that finds anddisplays the locations of all occurrence of a word within a line oftext. The line of text and the word to locate for are string typevalues to be passed into the function as parameters. Show the codefor function definition only.
Example of text is: ” The icon for apple is not a completeapple, but an apple with a bite taken”. The output of the programshould be ” the word apple appears at location : 13, 15, 18,20.
Note: The output of the program is just anexample. The output isn’t correct. Would you please
OR
OR