Is there a way I can read data from a file until a space? I have a file
John J. Doe
and I want to read the file and put John in 1 variable, J. in another variable and Doe in a final variable. How do I do this with ifstream?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can just read the values into std::string variables, this will automatically tokenize it.