[Solved] Issue with substr C++
As mentioned you can’t call substr() with a std::ifstream. What you probably meant was to take the parts from the line string read in a[i]= stoi(line.substr(4,2)); name[i]= line.substr(18,15); b[i]= stoi(line.substr(36,1)); Also note you’ll need to convert the substrings extracted to a number (instead of assigning them directly), hence I have added the stoi(). As also … Read more