c++ string 简单应用一
来源:互联网 发布:mac 网络测试工具 编辑:程序博客网 时间:2024/05/17 05:04
#include <iostream>
#include <string.h>
using namespace std;
inline void test(const char *title, bool value)
{
cout << title << " returns " << (value ? "true" : "false") << endl;
}
int main()
{
string s = "DEF";
cout << "s is " << s << endl;
string m;
cout << "plesse enter m:";
cin >> m;
cout << "length of m:" << m.length() << endl;
test("s <= \"ABC\"", s <= "ABC");
test("\"DEF\" <= s", "DEF" <= s);
m+=s;
cout << "m = m + s : " << m << endl;
cout << "length of m:" << m.length() << endl;
return 0;
}
#include <string.h>
using namespace std;
inline void test(const char *title, bool value)
{
cout << title << " returns " << (value ? "true" : "false") << endl;
}
int main()
{
string s = "DEF";
cout << "s is " << s << endl;
string m;
cout << "plesse enter m:";
cin >> m;
cout << "length of m:" << m.length() << endl;
test("s <= \"ABC\"", s <= "ABC");
test("\"DEF\" <= s", "DEF" <= s);
m+=s;
cout << "m = m + s : " << m << endl;
cout << "length of m:" << m.length() << endl;
return 0;
}
- c++ string 简单应用一
- C语言的简单应用(一)
- stl string 简单应用
- 对string 简单应用
- C语言简单示例(宏定义一应用)
- string.format的简单应用
- AsyncTask简单应用(一)
- android简单应用(一)
- c++string类型的应用
- c语言简单应用
- C#ArrayList简单应用
- C#ArrayList简单应用
- C#ArrayList简单应用
- 简单C语言应用
- C程序简单应用
- C语言简单应用
- C#中String类的简单应用
- C++之string vector bitset简单应用
- 字符串与整数、浮点数、无符号整数之间的转换常用函数
- Spring笔记_AOP简单例子
- 用clojure解决 euler problem 4
- sql基本原理以及运用场景
- 【动态规划+二分】奥运大包围
- c++ string 简单应用一
- poj 4048 计算几何(线段相交)金华邀请赛 E题
- 我伟大的爷爷
- CentOS GCC升级
- hello wxpython
- C++各种常见排序算法 冒泡排序,插入排序,快排序,选择排序,希尔排序
- 十道海量数据处理面试题与十个海量数据处理方法大总结
- SQL SERVER性能优化综述
- 约瑟夫环问题