读书人

问一个C++有屎以来最菜的有关问题

发布时间: 2012-01-07 21:41:55 作者: rapoo

问一个C++有屎以来最菜的问题。
为什么我编译
#include <iostream.h>
#include <string>

string test(){
return "333 ";
}

void main(){

int a=0;
}
这个提示error C2146: syntax error : missing '; ' before identifier 'test '
做习惯了JAVA,现在需要用到点C++,连格式都不懂了。

[解决办法]
#include <iostream>
#include <string>
using namespace std; <=========少了这一行

string test(){
return "333 ";
}

void main(){

int a=0;
}

读书人网 >VC/MFC

热点推荐