hi,
what would be the best (and jet simplest) way to avoid errors in the following situation.
so i am reading a two column file:
fileCode:fstream fs; int a, b; while(fs.good()){ fs >> a >> b; }
if values are missin, or not formated properly, the above read function will produce problems. what would be the most effective way to limit the read to 2 columns only and if no value is assigned then set the value to -1.Code:1 2 2 3 4 6 6 7 8 2 7 8 6 ...
thnx