i have a problem where i need to read lines of names from a file, and put the first line into a string then break up that string into three variables for first, middle, and last name.
how does one go about doing that?
i can only read the full name from the file, how can i breakup the full name?

thank you.
ps im using C++

Recommended Answers

All 2 Replies

Next time, consider matching your post topic with your question in your text.

You lead by asking how to read a line into a string, then in your post ask how to breakup the full name. I have to guess you read the line into a string and now the question is all about parsing.

In c++, I'd research that like this: https://www.google.com/search?q=parse+string+first+last+name+in+c%2B%2B
The good news here is that it appears this sort of work is well discussed.

You need to exercise some patience, and not keep asking the same question over and over again. And try to tag the post properly with the language you're using.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.