c++中string类如何用?定义#include<string>头文件后,再定义变量 string s1,s2; 编译出现问题, error C2

[复制链接]
查看11 | 回复4 | 2010-9-2 15:24:43 | 显示全部楼层 |阅读模式
加上using namespace std;就好了
回复

使用道具 举报

千问 | 2010-9-2 15:24:43 | 显示全部楼层
#include using namespace std;int main(){…}
回复

使用道具 举报

千问 | 2010-9-2 15:24:43 | 显示全部楼层
我觉得一种方法是,定义#include "iostream.h"不要用using namespace std;试一下,
回复

使用道具 举报

千问 | 2010-9-2 15:24:43 | 显示全部楼层
得加using namespace std;作为C++ stl中最最常用的东西,必须有效掌握
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行