I need to partially fill 2 arrays with data from a file and keep them parallel. But my current code gives me errors that look like giberish. If someone could even just help me d
istream::operator>> has overloads for neither arrays of strings nor arrays of integers.
You'll have to read each string and each integer in one at a time. Originally posted by @Seth Carnegie
input (infile, names, numoftoys); //your call was completely wrong
infile.ignore ('\n'); //notice the char instead of string
infile >> names >> numoftoys; //this won't work like this but at least we fixed the declaration error
If you are allowed to use std::vector, etc. We could provide a more C++ answer. Also please avoid using - using namespace std;