• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






yogurt_莹

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理
上一页 1 2 3 4

2018年9月18日

string的比较查找
摘要: #include<iostream> #include<string> using namespace std; int main(){ string str1("abcde"); //字符串初始化 string str2("abd"); cout<<(str1<str2)<<endl; //用(s 阅读全文
posted @ 2018-09-18 23:06 yogurt_莹 阅读(383) 评论(0) 推荐(0)
 

2018年9月17日

string的修改
摘要: #include<iostream> #include<string> using namespace std; int main(){ string str("abcde"); //字符串初始化 str[1]='a'; //用str[]修改单个字符 cout<<str<<endl; str.at( 阅读全文
posted @ 2018-09-17 22:35 yogurt_莹 阅读(345) 评论(0) 推荐(0)
 
string的输出
摘要: #include<iostream> #include<string> using namespace std; int main(){ string str("abcde"); //字符串初始化 cout<<str<<endl; //用str输出字符串 cout<<str.c_str()<<end 阅读全文
posted @ 2018-09-17 22:21 yogurt_莹 阅读(1924) 评论(0) 推荐(0)
 
string属性
摘要: #include<iostream> #include<string> using namespace std; int main(){ string str; //使用属性测容量str.capacity() cout<<str.capacity()<<endl; string str1(5,'a' 阅读全文
posted @ 2018-09-17 15:56 yogurt_莹 阅读(129) 评论(0) 推荐(0)
 
string定义及构造函数
摘要: #include<iostream>#include<string>using namespace std; int main(){ string str; cout<<str<<""<<str.empty()<<endl; //用str.empty检测字符串是否为空 (0,1) cout<<str 阅读全文
posted @ 2018-09-17 08:40 yogurt_莹 阅读(1588) 评论(0) 推荐(0)
 
string简介
摘要: 1.string的定义及构造函数 2.string的属性 3.string的输出 4.string的修改 阅读全文
posted @ 2018-09-17 00:20 yogurt_莹 阅读(159) 评论(0) 推荐(0)
 
上一页 1 2 3 4