I'm trying to store data from a .dat
file. Using a while loop and ifstream
I've managed to get it to print out exactly what I need, but I need to store what it's printing out so I can perform arithmetic operations on them. It seems like it's such a short leap from printing the info to storing the info, but I just can't figure it out.
Here's the code I've got so far:
int main()
{
char name;
cin.get(name);
ifstream inStream;
inStream.open("grade.dat");
while (name != ' ')
{
inStream.get(name);
cout << name;
}
return 0;
}