is empty. here is what the
ifstream infile;
infile.open("info.dat");
string line;
int counter = 0;
while (getline(infile, line))
{
getline(infile ,line ,'|');
b[counter] = line;
counter++;
cout << endl;
}
infile.close();
cout << b[0] << endl << b[1];
return 0;
}
b[0]
file contains.b[1]
I am trying to use the b[] array to separate the strings. in my .dat
at the bottom I was expecting "green dog" to print on the first line and "red fish" to print on the second line of the console.
green dog|red fish|brass monkey|purpe elephant||||||||||||
cout