I have a space delimited text file, from which I need to extract individual words to populate a vector<string>.
I’ve tried playing around with strtok, but I understand this is not working because strtok returns a char pointer. Any way to extract the words from the file, and fill the string vector with them? Thanks!
There are “fancier” ways, but in my opinion the following’s most understandable (and useful as a basis for variations) for beginners: