Question: I need help creating a function that does this please help in C++. Libraries included are: iostream, fstream, vector, sstream, string, cmath Please and Thank

I need help creating a function that does this please help in C++. Libraries included are:
iostream, fstream, vector, sstream, string, cmath
Please and Thank you.
bool getNextField(string &line, int &index, string &subString) string &line the line of data read from the file that needs to be parsed int &index the current starting position of the parsing. The first time this function is called for a new line, index should be set to zero. The function should update the index before returning, so that on the next call it will look at the next field. string &subString - the parsed string This function will receive the line of data read from the file, and starting at index, find the next string, which is all characters upto the next comma or ' '. Fields are delimited by commas. The string found not including the comma, is saved in the subString. The commas that separate the data should be skipped. The value of index should be updated as the line is processed. When the function returns, index should point to the next character to be processed, and will be used as the starting point for the next call to the function. This function must parse the line one character at a time. String functions like .find() may not be used
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
