摘要: A:如何在头文件中定义string类型?B:string是标准库std里的一种数据类型,所以必须先用using namespace再定义string数据类型 例如: 1 //string.h 2 3 std::string a("Hello world!"); 4 std::cout << a << endl; 5 6 //或者 7 8 using namespace std; 9 string a("Hello world!");10 cout << a << endl;----------------- 阅读全文
posted @ 2013-02-07 22:59 阿津 阅读(241) 评论(0) 推荐(0) 编辑