Instead of the vector of objects of type char std::vector<char> myVector;
you need to define a vector of objects of type std::string
std::vector<std::string> myVector;
This statement
myVector.push_back(token);
is invalid because you are trying to push a pointer instead of a character.
Also the if statement inside the while loop
while (token != NULL)
{
if (token != NULL)
{
myVector.push_back(token);
token = strtok_s(NULL, delims, &context);
}
}
is superflouos and can be removed
while (token != NULL)
{
myVector.push_back(token);
token = strtok_s(NULL, delims, &context);
}
Also take into account that in this loop
while (!myReadFile.eof()) {
myReadFile >> output;
}
object output is always overwritten. You should combine this loop with the loop of splitting output into tokens. Otherwise you are dealing with the last record of the file.