摘要: 概述string类基本可以看作和char * 类似,只不过前者封装了很多操作,关于char *的不方便性相信用过的人都能深刻感受到,而string类基本解决了这个问题。基本操作#include <string> // 使用 string 类时须包含这个文件#include <iostream>using namespace std;int main(){ string str1; // 输入与输出 cout << "输入字符串 str1" << endl; cin >> str1; getchar(); cout 阅读全文
posted @ 2013-05-01 22:43 Vincent_Xue 阅读(350) 评论(0) 推荐(0) 编辑