Need help in creating a C(NOT C+ OR C#) FUNCTION that will help split a string present in a Text file based on the presence of '-' . Conditions are that the length of the characters of the words can vary from 7 to 10 maximum and it would be done to random words. For example if the string in a random line of a text file is "Xylophone -a muscial instrument" I want the function to return "Xylophone" and " -a muscial instrument" separately. Again the words can vary from 7 to 10 characters but after the word, there is a gap and then there is '-', which I need to separate. In the function, I cant use break, continue exit, etc. Again it is necessary for it to be a function and not just a progrram, if required 2 different functions are also allowed for the desired outcome".
Need help in creating a C(NOT C+ OR C#) FUNCTION that will help split a string present in a Text file based on the presence of '-' . Conditions are that the length of the characters of the words can vary from 7 to 10 maximum and it would be done to random words.
For example if the string in a random line of a text file is "Xylophone -a muscial instrument" I want the function to return "Xylophone" and " -a muscial instrument" separately. Again the words can vary from 7 to 10 characters but after the word, there is a gap and then there is '-', which I need to separate. In the function, I cant use break, continue exit, etc. Again it is necessary for it to be a function and not just a progrram, if required 2 different functions are also allowed for the desired outcome".
Step by step
Solved in 4 steps with 4 images