1
不確定錯誤在這裏。這是我以前一直使用的標準文件打開方式。正確的東西正在被包括在內。這只是一個普通的流媒體。這有什麼問題?錯誤:「文件」之前的預期初始化程序,包括ifstream。
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
int main(){
struct item{
string item;
string type;
int price;
}
ifstream board;
board.open("messageBoard.txt");
}
確保編譯? – Raindrop7
'int price; }'缺少分號 –
答案:結構的末尾也需要分號。哎呀。 – grilam14