Pig latin Solution.ZIP

Pig latin Solution

Write a function that takes in an english sentence. This function should first calculate how many “words” are in the sentence (words being substrings separated by whitespace). It  should then allocate an array of the structure Word of this size (so large enough to hold the sentence). It should then store each of the words in that sentence to the array of structures in the english field. The function should then return this array to the calling function with a return
statement, along with a size through a reference parameter.
note: The allocation of this array should be done in the function itself, not in mainconverts the english field of the array to the piglatin field of the array and then displa the pig latin sentence the piglatin conversion of the word involves moving the first letter of the word to the end of the string and then adding “ay” to the
pig - igpay
cat - atcay
dog - ogday
If the word starts with a vowel, simply add “way” to the end of the word
apple - appleway
are - areway
Powered by