First time on this form and new c++ programmer. So I am given a file with an array of numbers, and im trying to use get line and stringstream to get the first line of code to come out on its own and the second line and so on. How would i go about that? Any input would be appreciated.
Array of codes
45 46 89
123 789 523
here is what i have so far:
void loadArray(int a[], int &n)
{
int x;
int y;
int r;
string s="";
string fname = getUserInput("Filename to load from: ");
ifstream infile(fname.c_str());
if (!infile)
errorMsg("File doesn't exist...terminating",true);
while (infile)
{
getline(infile, s);
stringstream ss;
ss.str(s);
ss>>x>>y>>r;