字符串表示方式
char a[10] = "asdf";
char a[10] = { 'a','b','c' };
字符串的输入输出
cout<<a<<endl;
cout << (void*)a<<endl;
cout << a[1] << endl;
cout << &a[1] << endl;
cout << a1 << endl;
当直接输出字符串的地址时,会输出至’/0‘的字符串
若需输出字符串地址,需用(void*)转换类型
cin>>a>>endl;
输入字符串,遇到空格会中断接收这时可以用gets()和puts(),gets会接受字符至‘/n’
gets_s(a);
puts(a);
字符数组操作





字符检查

string
构造函数
获取string对象的长度


string常见操作
增添


比较



获得字串

访问

查找




插入

string a1 = "asdASDASD123";
cout<< a1.find("123", 0, 3) << endl;
删除


判断是否为空

交换

反转




被折叠的 条评论
为什么被折叠?



