How would you find the nth word in C++?

Would you use regex? (not sure how though)

Or, would you go through the hard way, and iterate through every word, until you discarded (n-1) words and reached the nth word?

The second wouldn't be so short and clear to one who reads the code, therefore i was wondering if there's a neater way.

Thanks.
Oh
I just found LB's great post on istreamstring.
Thanks LB!
Topic archived. No new replies allowed.