I'm making a program to play the Craps game. Whenever it rolls, I want to put the total of the dice in a separate file. This is the code for the first roll and writing to the file
Code:
while(round <= 10) {
roundWin = false;
roundOver = false;
roll();
if(argc != 2) {
cout<<"Usage "<<argv[0]<<endl;
}
else {
ofstream otherFile ("totals.txt");
if(!otherFile.isOpen())
cout<<"Could not open file!"<<endl;
else {
otherFile<<total<<endl;
}
otherFile.close();
}
}
It tells me that
line 33 (which is ofstream otherFile ("totals.txt") "'variable std:fstream otherFile'" has initializer but incomplete type.
I'm not sure what this means. I make a new ofstream and give it the file "totals.txt". What else is needed?