-1

If my text file had something like:

111 Bob
222 Jim
333 Joe
444 Mike
555 Gary

I want to read each line and split each line into an ID number and a name in order to plug them into a function. How do I split up each line that is read from a file into two variables?

ss1111
  • 239
  • 1
  • 9
  • 20

1 Answers1

1

Read file line by line Answers of this question show how to read a text file line by line. And you can find how to split a string via this question. c++ boost split string

Community
  • 1
  • 1
DAG
  • 417
  • 4
  • 7