c++ 程序error C2143: syntax error : missing ';' before '}'代码如下 请问哪里有错误
#include<iostream>#include<cstdlib>#include<stdexcept>#include<string>#include"simula...
#include <iostream>
#include <cstdlib>
#include <stdexcept>
#include <string>
#include "simulator.h"
#include "fifo.h"
using namespace std;
int main (int argc, char *argv[]) {
if (argc != 2) {
cerr << "Usage: " << argv[0] << " data-file\n";
return EXIT_FAILURE;
}
try {
string file = argv[1];
simulator *s = new fifo (2);
s->simulate(file);
delete s;
}
catch(exception& e) {
cerr << e.what() << endl;
}
catch(...) {
cerr << "Unknown exception caught!" << endl;
}
return EXIT_FAILURE;
}编译器是VC++6.0 展开
#include <cstdlib>
#include <stdexcept>
#include <string>
#include "simulator.h"
#include "fifo.h"
using namespace std;
int main (int argc, char *argv[]) {
if (argc != 2) {
cerr << "Usage: " << argv[0] << " data-file\n";
return EXIT_FAILURE;
}
try {
string file = argv[1];
simulator *s = new fifo (2);
s->simulate(file);
delete s;
}
catch(exception& e) {
cerr << e.what() << endl;
}
catch(...) {
cerr << "Unknown exception caught!" << endl;
}
return EXIT_FAILURE;
}编译器是VC++6.0 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询