一段极简单的程序VC6不能通过编译,为什么(20分)?
//--------------test.h----------------
#include <vector>
using namespace std;
class test
{
public:
test(int capacity):_tast(capacity){}//这么写对马?
int capacity;
}
//------------test.cpp----------------
#include <iostream>
#include "test.h"
using namespace std;
void main()
{
int cap;
cin>>cap;
test t(cap);
cout<<t.capacity;
system("pause");
}
得到如下报错:
Compiling...
test.cpp
c:\windows\desktop\test\test.cpp(3) : error C2143: syntax error : missing ';' before 'PCH creation point'
Error executing cl.exe.
test.exe - 1 error(s), 0 warning(s)
别告诉我用DEV,我机器装不了!
难道真的又是因为命名空间的问题?