您的位置:首页 > 其它

string' does not name a type 及命名空间

2014-04-03 16:02 676 查看
在做c++ primer 中习题时,发现string' does not name a type;


#include <cstdlib>

#include <iostream>

#include <string>

string sa[10];

int ia[10];

using namespace std;

int main(int argc, char *argv[])

{

string sa2[10];

int ia2[10];

for (int i=0; i!=0

cout <<*sa<<endl;

system("PAUSE");

return EXIT_SUCCESS;

}



出现string' does not name a type。

需要将定义放在using namespace std 后。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐