当前位置:网站首页>STL string复制比较
STL string复制比较
2022-07-17 18:03:00 【joker_0030】
#include <iostream>
using namespace std;
//#pragma warning(disable:4996)//去除警告4996
void StrFunction()
{
string str2("aabde");
string str3("aaqdefg");
//cout << (str2 > str3) << endl;//重载比较运行算符,结果是真或假。
//cout << str2.compare(str3) << endl;// 判断str2>str3。
//cout << str2.compare(1,2,str3) << endl;// 判断str2下标为[1,2]与str3比较。str2>str3。
//cout << str2.compare(1,3,str3,1,2) << endl;// str2下标为[1,3]与str3下标为[1,2]比较判断str2>str3。
//cout << str2.compare(str3) << endl;// 判断str2>str3。
char arrStr[6] = { 0 };
str2.copy(arrStr,2,3);//将2个字符从下标为3的位置复制到arrStr.
cout << arrStr << endl;
}
int main()
{
StrFunction();
system("pause");
return 0;
}
边栏推荐
- Three minutes to understand the primary key, foreign key, non empty, unique and default constraints in mysql, and how to create a table
- 力扣198-213 打家劫舍Ⅰ、Ⅱ——动态规划
- [Yugong series] July 2022 go teaching course 012 forced type conversion
- Uio-66 - (COOH) 2 modified polyamide nanofiltration membrane | zif-8/pvp composite nanofiber membrane | uio-66-nh2 modified polyamide nanofiltration membrane
- LeetCode 0117. 填充每个节点的下一个右侧节点指针 II
- Investment logic in market "uncertainty" 2020-03-18
- How can MySQL delete data tables and associated data tables
- Gold nanoparticles modified mil-101 framework material (AuNPs / mil-101) / loaded cof-tppa-1 (Au NPs / cof-tppa-1) | Qiyue reagent
- Ossimport migration path
- Uio-66 | fe3o4/cu3 (BTC) 2 metal organic framework (MOF) nanocomposites supported on silver nanoparticles | nagdf4:yb, er upconversion nanoparticles @zif-8
猜你喜欢
[email protected] | Porphyrin encapsulated organometallic frame materials [email protected] |

XML file parsing

Ultrasonic sensor (ch101 & ch201) - I

MatrixCube揭秘 101——MatrixCube的功能与架构

XML文件解析

Li Kou 413 division of equal difference sequence dynamic programming

Fluorine modified uio-66 | 3,4-dihydroxybenzaldehyde modified uio-66-nh2 | camptothecin derivative / oligopeptide @zif-8 nano drug carrier system

最懂你的服装设计师是AI?让用户 “凭心意” 生成数字服装#Adidas OZWORLD

Uio-66 | fe3o4/cu3 (BTC) 2 metal organic framework (MOF) nanocomposites supported on silver nanoparticles | nagdf4:yb, er upconversion nanoparticles @zif-8

MOF customized product | n-k2ti4o9/g-c3n4/uio-66 ternary composite | paper based au-aginse2-zif-8 Nanocomposite
随机推荐
【js逆向爬虫】-有道翻译js逆向实战
Advanced C language -- character function and string function
LeetCode 0118. 杨辉三角
MySQL sort index failure?
The difference and use between get request and post request
MYCAT divides the database and table according to the hash value of the string range
实现自动记录日志
torch.utils.data.DataLoader说明
最懂你的服装设计师是AI?让用户 “凭心意” 生成数字服装#Adidas OZWORLD
Ossimport migration path
Basic database operations in MySQL
响应式织梦模板物流货运服务类网站
Azkaban installation documentation
Li Kou 70 - climbing stairs - Dynamic Planning
OSSImport迁移之路
Visual ETL tool kettle concept, installation and practical cases
C语言进阶——自定义类型:结构体 枚举 联合
松下A6伺服驱动器外部绝对值光栅尺全闭环参数设置
标签球问题
Differences between get requests and post requests and usage examples