How do I access individual elements of a line read from a file?
I used the following to read a line from a file:
getline(infile, data) // where infile is an object of ifstream and data is the variable where the line will be stored
The following line is stored in data : "The quick brown fox jumped over the lazy dog"
How do I access particular elements of the line now? What if I want to play around with the second element ( quick ) of the line or get hold of a certain word in the line? How do I select it?
Any help will be appreciated