我不断收到错误消息:发现意外的文件结尾,我完全迷路了。我检查了咖喱大括号和括号,我在课程的末尾放了一个分号,我无法弄清楚它有什么问题。多谢。
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
class operations{
void checkout(){
cout << "Check out here!!";
}
}
void main(){
string item;
int choice;
cout << "What do you want to do? " << endl;
cout << "Press 1 for checking out " << endl;
cout << "Press 2 for stocking " << endl;
cout << "Press 3 looking at recipts " << endl;
cin >> choice;
cout << choice;
if(choice == 1){
void checkout();
}
/*ofstream myfile;
myfile.open("inventory.txt");
if(myfile.is_open()){
cout << "Enter a grocery item" << endl;
getline(cin,item);
myfile << item;
}
cout << "Your grocery item is " << item;
myfile.close();
system("pause");*/
};