reading files that contain both string and int

Mar 5, 2016 at 9:25pm
txt. file contains
1
2
human#dog#24
cow#fish#64 


how do i turn the .txt file into an array/2d array but also removing the #.

Mar 5, 2016 at 9:37pm
First skip whitespace. Then std::getline string, with # as delimiter. Twice. Last read an integer.

Repeat for each line.
Mar 5, 2016 at 9:42pm
You can use std::getline() whose last parameter is a delimiter which in this case, is '#'.
Topic archived. No new replies allowed.