当前位置: 首页 > news >正文

【C++初阶】string类的常见基本使用

在这里插入图片描述

👦个人主页:@Weraphael
✍🏻作者简介:目前学习C++和算法
✈️专栏:C++航路
🐋 希望大家多多支持,咱一起进步!😁
如果文章对你有帮助的话
欢迎 评论💬 点赞👍🏻 收藏 📂 加关注✨


目录

  • 一、什么是STL
  • 二、string类概念总结
  • 三、string类的常用接口(重点)
      • 3.1 常见的四种构造(初始化)
      • 3.2 常见容量操作
        • 3.2.1 size
        • 3.2.2 empty
        • 3.2.3 clear
  • 四、string类对象的修改操作
      • 4.1 push_back
      • 4.2 append
      • 4.3 运算符重载+=
      • 4.4 insert
      • 4.5 erase
      • 4.6 swap
      • 4.7 c_str
      • 4.8 find
      • 4.9 pop_back
      • 4.10 substr
      • 4.11 rfind
      • 4.12 operator+
  • 五、迭代器iterator
      • 5.1 什么是迭代器
      • 5.2 常见的string类迭代器
        • 5.2.1 begin
        • 5.2.2 end
        • 5.2.3 rbegin + rend --- 反向迭代器
        • 5.2.4 const修饰的对象
  • 六、string类遍历操作
      • 6.1 string的底层重载operator[]
      • 6.2 迭代器遍历
      • 6.3 语法糖(范围for)
      • 6.4 补充:迭代器的意义
  • 七、string的读入与输出
      • 7.1 getline - 输入
      • 7.2 puts - 输出
  • 八、string转化为其他类型
  • 九、其他类型转string

一、什么是STL

STL(standard template libaray - 标准模板库):是C++标准库的重要组成部分,不仅是一个可复用的组件库,而且是一个包罗数据结构与算法的软件框架。

STL的六大组件:

在这里插入图片描述

二、string类概念总结

  1. string是一个管理字符数组的类

  2. 该类的接口与常规容器的接口基本相同,再添加了一些专门的函数用来操作string的常规操作。例如:push_back等(后面会详细介绍)

  3. string在底层实际是:basic_string;模板类的别名:typedef basic_string<char, char_traits, allocator> string

  4. 在使用string类时,必须包含头文件#include <string>

三、string类的常用接口(重点)

3.1 常见的四种构造(初始化)

  1. 构造空的string类对象,即空字符串
#include <iostream>
#include <string>
using namespace std;int main()
{// 构造空的string类对象s1string s1;cout << "s1的内容为:" << s1 << endl;return 0;
}

【输出结果】

在这里插入图片描述

  1. C语言的格式字符串来构造string类对象
#include <iostream>
#include <string>
using namespace std;int main()
{// 用C格式字符串构造string类对象s2string s2("hello world");cout << "s2的内容为:" << s2 << endl;return 0;
}

【输出结果】

在这里插入图片描述

  1. 拷贝构造函数
#include <iostream>
#include <string>
using namespace std;int main()
{// 用C格式字符串构造string类对象s2string s2("hello world");// 拷贝构造string s3(s2);cout << "s3的内容为:" << s3 << endl;return 0;
}

【输出结果】

在这里插入图片描述

  1. string类支持赋值运算符重载=
#include <iostream>
#include <string>
using namespace	std;int main()
{string s1 = "hello world";cout << s1 << endl;s1 = "hello China";cout << s1 << endl;return 0;
}

【输出结果】

在这里插入图片描述

3.2 常见容量操作

3.2.1 size

返回字符串的有效长度(不包含'\0'

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("hello world");int s1_lengrh = s1.size();cout << "s1的有效长度为:" << s1_lengrh << endl;return 0;
}

【输出结果】

在这里插入图片描述

注意:'\0’是标识字符串结束的特殊字符,不算有效字符!

3.2.2 empty

检测字符是否为空字符串。如果是空字符串返回true,否则返回false

#include <iostream>
#include <string>
using namespace std;int main()
{string s1;string s2("hello world");cout << s1.empty() << endl;cout << s2.empty() << endl;return 0;
}

【输出结果】

在这里插入图片描述

3.2.3 clear

清空有效字符clear

#include <iostream>
#include <string>
using namespace std;int main()
{string s2("hello world");s2.clear();cout << "s2的内容为:" << s2 << endl;return 0;
}

【输出结果】

在这里插入图片描述

四、string类对象的修改操作

4.1 push_back

功能:尾插一个字符

#include <iostream>
#include <string>
using namespace	std;int main()
{string s1("h");s1.push_back('i');cout << s1 << endl;return 0;
}

【输出结果】

在这里插入图片描述

4.2 append

功能:尾插字符串

#include <iostream>
#include <string>
using namespace	std;int main()
{string s1("hello ");s1.append("world");cout << s1 << endl;return 0;
}

【输出结果】

在这里插入图片描述

4.3 运算符重载+=

既可以尾插一个字符,也能尾插一个字符串。

#include <iostream>
#include <string>
using namespace	std;int main()
{string s1("h");// 尾插一个字符s1 += 'i';cout <<  "s1 = " << s1 << endl;string s2("hello ");// 尾插一个字符串s2 += "world";cout << "s2 = " << s2 << endl;return 0;
}

【输出结果】

在这里插入图片描述

4.4 insert

  • 功能:插入字符或者字符串
  • 缺点:效率低,特别是头插

【代码示例】

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("world");// 头插s1.insert(0, "hello");cout << s1 << endl;// 限制插入的个数string s2("hello");s2.insert(0, "world", 3);cout << s2 << endl;// 配合迭代器string s3("11111");// 尾插3个xs3.insert(s3.begin() + 5, 3, 'x');cout << s3 << endl;return 0;
}

【输出结果】

在这里插入图片描述

4.5 erase

功能:删除某个位置的字符或者字符串

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("hello world");// 从下标为2往后删除3个字符s1.erase(2, 3);cout << s1 << endl;string s2("hello world");// 不指定删除的个数,该下标往后全删除s2.erase(2);cout << s2 << endl;//头删string s3("hello world");s3.erase(s3.begin());//尾删s3.erase(s3.end() - 1);cout << s3 << endl;return 0;
}

【输出结果】

在这里插入图片描述

4.6 swap

功能:交换

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("hello");string s2("world");s1.swap(s2);cout << "s1 = " << s1 << endl;cout << "s2 = " << s2 << endl;return 0;
}

【输出结果】

在这里插入图片描述

4.7 c_str

功能:将string转化为C字符串

比如printf只能打印内置类型,如果想打印string类型,需要使用c_str

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("hello world");printf("%s\n", s1.c_str());return 0;
}

【输出结果】

在这里插入图片描述

4.8 find

功能:查找字符。找到第一次出现的字符下标,如果没有找到会返回npos,本质就是-1

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("hello world");int pos = s1.find("o");cout << "第一次出现的位置:" << pos << endl;// 还可以指定查找的起始位置pos = s1.find("o", 6);cout << "第二次出现的位置:" << pos << endl;return 0;
}

【输出结果】

在这里插入图片描述

4.9 pop_back

功能:尾删一个字符

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("hello world");s1.pop_back();cout << s1 << endl;return 0;
}

【输出结果】

在这里插入图片描述

4.10 substr

功能:截取子串

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("hello world");// 从下标为0开始往后截取长度为5的子串cout << s1.substr(0, 5) << endl;// 如果没有第二个参数,默认截到尾cout << s1.substr(0) << endl;return 0;
}

【输出结果】

在这里插入图片描述

4.11 rfind

功能:从字符串的后面开始往前找第一次出现的字符

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("hello world");int pos = s1.rfind('o');cout << pos << endl;return 0;
}

【输出结果】

在这里插入图片描述

4.12 operator+

string类重载了运算符+可以拼接2个字符串

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("hello ");string s2("world");string s3 = s1 + s2;cout << s3 << endl;return 0;
}

【输出结果】

在这里插入图片描述

五、迭代器iterator

5.1 什么是迭代器

现阶段可以理解迭代器是像指针一样的类型,但也有可能是指针,也有可能不是指针。

string迭代器的语法形式:

// string::iterator是类型
// it是变量名
string::iterator it = xxx;

5.2 常见的string类迭代器

5.2.1 begin

【文档描述】

在这里插入图片描述

【代码演示】

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("hello world");// 返回的是指向字符串的第一个字符string::iterator it = s1.begin();// 迭代器是像指针一样的类型// 因此解引用就可以访问第一个字符cout << *it << endl;return 0;
}

【程序结果】

在这里插入图片描述

5.2.2 end

【文档描述】

在这里插入图片描述

【代码示例】

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("hello world");string::iterator it = s1.end() - 1;cout << *it << endl;return 0;
}

【输出结果】

在这里插入图片描述

5.2.3 rbegin + rend — 反向迭代器

【文档描述】

在这里插入图片描述

【代码示例】

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("hello world");string::reverse_iterator rit = s1.rbegin();while (rit != s1.rend()){cout << *rit;rit++;}cout << endl;return 0;
}

【输出结果】

在这里插入图片描述

注:如果觉得string::reverse_iterator太长,可以使用auto代替。

5.2.4 const修饰的对象

注:const修饰的对象不能用普通迭代器

看看以下代码

#include <iostream>
#include <string>
using namespace std;void print(const string& s)
{string::iterator sit = s.begin();while (sit != s.end()){cout << *sit;sit++;}cout << endl;
}int main()
{string s1("hello world");//封装print函数来打印print(s1);return 0;
}

【错误报告】

在这里插入图片描述

const修饰的对象只能用const的迭代器

在这里插入图片描述

【正确代码】

#include <iostream>
#include <string>
using namespace std;void print(const string& s)
{string::const_iterator sit = s.begin();while (sit != s.end()){cout << *sit;sit++;}cout << endl;
}int main()
{string s1("hello world");//封装print函数来打印print(s1);return 0;
}

【输出结果】

在这里插入图片描述

六、string类遍历操作

因为string底层是支持流提取>>,用cout就可以直接打印string字符串的内容,但是打印的结果比较固定。因此以下三种方式既可以访问遍历,也可以对其内容修改打印。

6.1 string的底层重载operator[]

相当于数组下标的访问

#include <iostream>
#include <string>
using namespace std;int main()
{string s2("hello world");for (int i = 0; i < s2.size(); i++){// 遍历string字符串cout << s2[i];}cout << endl;return 0;
}

【输出结果】

在这里插入图片描述

当然还可以对字符串进行修改

以下是将字符串的内容都+1

#include <iostream>
#include <string>
using namespace std;int main()
{string s2("hello world");// 修改for (int i = 0; i < s2.size(); i++){s2[i]++;}// 输出for (int i = 0; i < s2.size(); i++){cout << s2[i];}cout << endl;return 0;
}

【输出结果】

在这里插入图片描述

注意:这里需要区分string和普通数组

  • s2[i]的底层是调用s2.operator[](i)函数
    在这里插入图片描述
  • 普通数组的底层是解引用操作
	char ch1[] = "abcdef";ch1[0];// 访问下标为0的元素

ch1[0]的底层含义是:*(ch1 + 0)

6.2 迭代器遍历

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("hello world");string::iterator it = s1.begin();while (it != s1.end()){cout << *it;it++;}cout << endl;return 0;
}

【程序结果】

在这里插入图片描述

当然也可以对字符串的内容进行修改

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("hello world");string::iterator it = s1.begin();while (it != s1.end()){(*it)++;it++;}it = s1.begin();while (it != s1.end()){cout << *it;it++;}cout << endl;return 0;
}

【输出结果】

在这里插入图片描述

在这里就有的人想,迭代器的代码要写这么多,还不如用下标来访问。所以,迭代器的意义是什么呢? 让我们接着往下看

6.3 语法糖(范围for)

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("hello world");for (auto x : s1){cout << x;}cout << endl;return 0;
}

【输出结果】

在这里插入图片描述

范围for同样支持修改

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("hello world");// 修改for (auto& x : s1){x++;}// 输出结果for (auto x : s1){cout << x;}cout << endl;return 0;
}

【输出结果】

在这里插入图片描述

范围for虽然很香,但是有个致命的缺点:**不能倒着遍历,只有反向迭代器可以倒着遍历。 **

6.4 补充:迭代器的意义

范围for又和迭代器有啥关系呢?迭代器的意义又是什么呢?

  1. 其实,范围for代码短,之所以是这么好用是因为:范围for的底层就是用迭代器实现的!!!

我们可以利用反汇编来看看代码底层:

11111111

范围for的底层就是调用了beginend

  1. 迭代器提供了一种统一的方式访问和修改容器的数据

以下以vector容器为例

#include <iostream>
#include <vector>
using namespace std;int main()
{vector<int> v;// 尾插数据v.push_back(1);v.push_back(2);v.push_back(3);v.push_back(4);// 迭代器vector<int>::iterator vit = v.begin();while (vit != v.end()){cout << *vit << ' ';vit++;}cout << endl;// 范围forfor (auto e : v){cout << e << ' ';}cout << endl;return 0;
}

【输出结果】

在这里插入图片描述

如果一个容器支持迭代器,那么它必定支持访问for,反之就不一定了。

这里再提一嘴,很多人认为下标访问是主流,但是使用下标访问的空间必须是连续的,所以当我拿出链表,阁下又该如何应对呢?因此迭代器是可以访问链表的。

  1. 迭代器可以和算法配合使用

这里给大家介绍一个浅浅介绍一个算法(后序会补充),-- sort

【文档描述】

在这里插入图片描述

【代码演示】

#include <vector>
#include <iostream>
#include <algorithm> // 算法库头文件
using namespace std;int main()
{vector<int> v;// 尾插数据v.push_back(10);v.push_back(3);v.push_back(2);v.push_back(5);// 迭代器cout << "sort前:";for (auto x : v){cout << x << ' ';}cout << endl;sort(v.begin(), v.end());// 迭代器打印sort后的结果cout << "sort后:";vector<int>::iterator vit = v.begin();while (vit != v.end()){cout << *vit << ' ';vit++;}cout << endl;return 0;
}

【程序结果】

在这里插入图片描述

七、string的读入与输出

7.1 getline - 输入

注意:cinscanf读取到空格或者回车就不再往后读取了

#include <iostream>
#include <string>
using namespace std;int main()
{string s1;// 输入cin >> s1;// 输出cout << s1 << endl;return 0;
}

【输出结果】

在这里插入图片描述

getline可以读入空格

#include <iostream>
#include <string>
using namespace std;int main()
{string s1;// 输入getline(cin, s1);// 输出cout << s1 << endl;return 0;
}

【输出结果】

在这里插入图片描述

7.2 puts - 输出

因为string类重载了流插入<<和流提取>>,因此可以支持cincout的输入输出。除此之外还能用puts来输出string类的字符串(自带换行的)。注意:putsprintf只能打印内置类型的字符串,因此可以用c_str转化为C语言的字符串

#include <iostream>
#include <string>
using namespace std;int main()
{string s1("hello world");puts(s1.c_str());return 0;
}

【输出结果】

在这里插入图片描述

八、string转化为其他类型

在这里插入图片描述

#include <iostream>
#include <string>
using namespace std;int main()
{// 转整型int convert1 = stoi("1111111");double convert2 = stod("3.14");float convert3 = stof("6.66");cout << convert1 << endl;cout << convert2 << endl;cout << convert3 << endl;return 0;
}

【输出结果】

在这里插入图片描述

九、其他类型转string

在这里插入图片描述

#include <iostream>
#include <string>
using namespace std;int main()
{// 整型转stringstring s1 = to_string(1111);// double转string string s2 = to_string(3.14);return 0;
}

【输出结果】

在这里插入图片描述

相关文章:

【C++初阶】string类的常见基本使用

&#x1f466;个人主页&#xff1a;Weraphael ✍&#x1f3fb;作者简介&#xff1a;目前学习C和算法 ✈️专栏&#xff1a;C航路 &#x1f40b; 希望大家多多支持&#xff0c;咱一起进步&#xff01;&#x1f601; 如果文章对你有帮助的话 欢迎 评论&#x1f4ac; 点赞&#x1…...

【ArcGIS Pro二次开发】(60):按图层导出布局

在使用布局导图时&#xff0c;会遇到如下问题&#xff1a; 为了切换图层和导图方便&#xff0c;一般情况下&#xff0c;会把相关图层做成图层组。 在导图的时候&#xff0c;如果想要按照图层组进行分开导图&#xff0c;如上图&#xff0c;想导出【现状图、规划图、管控边界】3…...

docker-desktop数据目录迁移

1.退出docker-desktop后执行 wsl --list -v 如下 NAME STATE VERSION * docker-desktop Stopped 2docker-desktop-data Stopped 22.执行以下命令进行数据导出&#xff1a;&#xff08;需要等待命令执行完成&#xff09…...

03.利用Redis实现缓存功能---解决缓存穿透版

学习目标&#xff1a; 提示&#xff1a;学习如何利用Redis实现添加缓存功能解决缓存穿透版 学习产出&#xff1a; 缓存穿透讲解图&#xff1a; 解决方案&#xff1a; 采用缓存空对象采用布隆过滤器 解决方案流程图&#xff1a; 1. 准备pom环境 <dependency><gro…...

全景图!最近20年,自然语言处理领域的发展

夕小瑶科技说 原创 作者 | 小戏、Python 最近这几年&#xff0c;大家一起共同经历了 NLP&#xff08;写一下全称&#xff0c;Natural Language Processing&#xff09; 这一领域井喷式的发展&#xff0c;从 Word2Vec 到大量使用 RNN、LSTM&#xff0c;从 seq2seq 再到 Attenti…...

Mybatis参数传递

Map传参, #{}里的key要一一对应不能乱写&#xff0c;如果不存在则会填充NULL&#xff0c;不会报错 Map<String, Object> map new HashMap<>(); // 让key的可读性增强 map.put("carNum", "103"); map.put("brand", "奔驰E300L&…...

手动实现 Spring 底层机制 实现任务阶段一编写自己 Spring 容器-准备篇【2】

&#x1f600;前言 手动实现 Spring 底层机制的第2篇 实现了任务阶段一编写自己 Spring 容器-准备篇【2】 &#x1f3e0;个人主页&#xff1a;尘觉主页 &#x1f9d1;个人简介&#xff1a;大家好&#xff0c;我是尘觉&#xff0c;希望我的文章可以帮助到大家&#xff0c;您的…...

部署模型并与 TVM 集成

本篇文章译自英文文档 Deploy Models and Integrate TVM tvm 0.14.dev0 documentation 更多 TVM 中文文档可访问 →Apache TVM 是一个端到端的深度学习编译框架&#xff0c;适用于 CPU、GPU 和各种机器学习加速芯片。 | Apache TVM 中文站 本节介绍如何将 TVM 部署到各种平台&…...

Android Navigation 导航切换fragment用法

对于Android Navigation组件的导航到Fragment&#xff0c;您可以按照以下步骤操作&#xff1a; 首先&#xff0c;在您的项目的build.gradle文件中添加Navigation依赖&#xff1a; dependencies {def nav_version "2.3.4"implementation "androidx.navigation…...

Anaconda Prompt使用pip安装PyQt5-tools后无法打开Spyder或闪退

艹&#xff01;MLGBZD! 真TMD折腾人&#xff01; 出现原因&#xff1a; 首次安装完Anaconda3-2023.07-1-Windows-x86_64.exe后首次打开Spyder&#xff0c;此时是没有问题的&#xff0c;然后打开Anaconda Prompt&#xff0c;查看有哪些包&#xff0c;pip list 这时候开始首次安…...

【jvm】jvm整体结构(hotspot)

目录 一、说明二、java代码的执行流程三、jvm的架构模型3.1 基于栈式架构的特点3.2 基于寄存器架构的特点 一、说明 1.hotspot vm是目前市场上高性能虚拟机的代表作之一 2.hotspot采用解释器与即时编译器并存的架构 3.java虚拟机是用来解释运行字节码文件的&#xff0c;入口是字…...

通达信波段选股公式,使用钱德动量摆动指标(CMO)

钱德动量摆动指标(CMO)是由图莎尔钱德发明的&#xff0c;取值范围在-100到100之间&#xff0c;是捕捉价格动量的技术指标。该指标计算近期涨幅之和与近期跌幅之和的差值&#xff0c;然后将计算结果除以同期所有价格波动的总和。本文的波段选股公式使用均线识别趋势&#xff0c;…...

家电维修小程序开发指南:从零搭建到上线

随着科技的发展和人们生活水平的提高&#xff0c;家电已经成为人们生活中不可或缺的一部分。然而&#xff0c;随之而来的是家电维修门店业务的繁忙和效率的考验。为了提高家电维修门店的效率和服务质量&#xff0c;建立一个便捷高效的小程序已成为必要的选择。 本文将介绍一个简…...

玩赚音视频开发高阶技术——FFmpeg

随着移动互联网的普及&#xff0c;人们对音视频内容的需求也不断增加。无论是社交媒体平台、电商平台还是在线教育&#xff0c;都离不开音视频的应用。这就为音视频开发人员提供了广阔的就业机会。根据这些年来网站上的音视频开发招聘需求来看&#xff0c;音视频开发人员的需求…...

python 变量赋值 修改之后 原值改变

python 是一种动态语言&#xff0c;因此变量的类型和值 在运行时均可改变。当我们将一个变量赋值给另一个变量时&#xff0c;实际上是将变量的引用地址传递给新的变量&#xff0c;这意 味着新旧变量将指向同一个位置。因此&#xff0c;在更改其中一个变量的值时&#xff0c;另一…...

拂袖一挥,zipfile秒列zip包内容

使用wxpython列出文件夹中的zip文件及内容 最近在做一个文件管理的小工具,需要列出选择的文件夹下的所有zip压缩文件,并在点击某个zip文件时能够显示其中的内容。为此我使用了wxpython来实现这个功能。 1. 导入需要的模块 首先导入程序需要的模块: import wx import os imp…...

InnoDB文件物理结构解析2 - FIL_PAGE_INDEX

1. 关于索引组织表 InnoDB使用的是索引组织表(IOT)的方式存储表记录&#xff0c;索引组织表以主键构建一个B-tree的数据结构来存储行记录&#xff0c;行记录存储在树的叶节点内。这与Oracle数据库是不同的&#xff0c;Oracle数据库默认创建的表是堆组织表(HOT)&#xff0c;HOT…...

XML-BEANS compiled schema: Could not locate compiled schema resource 异常处理

使用poi5.2.2生成ppt&#xff0c;生成堆叠图&#xff0c;设置值时抛出异常 XML-BEANS compiled schema: Could not locate compiled schema resource org/apache/poi/schemas/ooxml/system/ooxml/stoverlappercent872etype.xsb (org.apache.poi.schemas.ooxml.system.ooxml.st…...

IOC容器 - Autofac

DI&#xff08;依赖注入&#xff09;&#xff1a;DI&#xff08;Dependency Injection&#xff09;是一种实现松耦合和可测试性的软件设计模式。它的核心思想是将依赖关系的创建与管理交给外部容器&#xff0c;使得对象之间只依赖于接口而不直接依赖于具体实现类。通过依赖注入…...

用i18n 实现vue2+element UI的国际化多语言切换详细步骤及代码

一、i18n的安装 这个地方要注意自己的vue版本和i1n8的匹配程度&#xff0c;如果是vue2点几&#xff0c;记得安装i18n的8版本&#xff0c;不然会自动安装的最新版本&#xff0c;后面会报错哦&#xff0c;查询了下资料&#xff0c;好像最新版本是适配的vue3。 npm install vue-…...

将数据库表导出为C#实体对象

数据库方式 use 数据库;declare TableName sysname 表名 declare Result varchar(max) /// <summary> /// TableName /// </summary> public class TableName {select Result Result /// <summary>/// CONVERT(NVARCHAR(500), ISNULL(ColN…...

如何区分 “通信网络安全防护” 与 “信息安全” 的考核重点?

“通信网络安全防护” 与 “信息安全” 的考核重点可以从以下几个方面进行区分&#xff1a; 保护对象 通信网络安全防护&#xff1a;重点关注通信网络系统本身&#xff0c;包括网络基础设施&#xff0c;如路由器、交换机、基站等&#xff0c;以及网络通信链路和相关设备。同…...

Qt Test功能及架构

Qt Test 是 Qt 框架中的单元测试模块&#xff0c;在 Qt 6.0 中提供了全面的测试功能。 一、主要功能 核心功能 1. 单元测试框架 提供完整的单元测试基础设施 支持测试用例、测试套件的组织和执行 包含断言宏和测试结果收集 2. 测试类型支持 单元测试&#xff1a;对单个函…...

QtDBus模块功能及架构解析

Qt 6.0 中的 QtDBus 模块是一个用于进程间通信&#xff08;IPC&#xff09;的核心模块&#xff0c;它基于 D-Bus 协议实现。D-Bus 是一种在 Linux 和其他类 Unix 系统上广泛使用的消息总线系统&#xff0c;允许应用程序和服务相互通信。 一、QtDBus模块主要功能&#xff1a; 1…...

pe文件结构(TLS)

TLS 什么是TLS? TLS是 Thread Local Storage 的缩写&#xff0c;线程局部存储。主要是为了解决多线程中变量同步的问题 如果需要要一个线程内部的各个函数调用都能访问&#xff0c;但其它线程不能访问的变量&#xff08;被称为static memory local to a thread 线程局部静态变…...

OpenCV CUDA模块图像处理------图像融合函数blendLinear()

操作系统&#xff1a;ubuntu22.04 OpenCV版本&#xff1a;OpenCV4.9 IDE:Visual Studio Code 编程语言&#xff1a;C11 算法描述 该函数执行 线性融合&#xff08;加权平均&#xff09; 两个图像 img1 和 img2&#xff0c;使用对应的权重图 weights1 和 weights2。 融合公式…...

C# Wkhtmltopdf HTML转PDF碰到的问题

最近碰到一个Html转PDF的需求&#xff0c;看了一下基本上都是需要依赖Wkhtmltopdf&#xff0c;需要在Windows或者linux安装这个可以后使用。找了一下选择了HtmlToPDFCore&#xff0c;这个库是对Wkhtmltopdf.NetCore简单二次封装&#xff0c;这个库的好处就是通过NuGet安装HtmlT…...

Java 大视界 -- 基于 Java 的大数据分布式计算在蛋白质组学数据分析中的加速与优化(255)

&#x1f496;亲爱的朋友们&#xff0c;热烈欢迎来到 青云交的博客&#xff01;能与诸位在此相逢&#xff0c;我倍感荣幸。在这飞速更迭的时代&#xff0c;我们都渴望一方心灵净土&#xff0c;而 我的博客 正是这样温暖的所在。这里为你呈上趣味与实用兼具的知识&#xff0c;也…...

玄机-日志分析-IIS日志分析

1.phpstudy-2018站点日志.(.log文件)所在路径&#xff0c;提供绝对路径 2.系统web日志中状态码为200请求的数量是多少 3.系统web日志中出现了多少种请求方法 4.存在文件上传漏洞的路径是什么(flag{/xxxxx/xxxxx/xxxxxx.xxx} 5.攻击者上传并且利用成功的webshell的文件名是什…...

day45python打卡

知识点回顾&#xff1a; tensorboard的发展历史和原理tensorboard的常见操作tensorboard在cifar上的实战&#xff1a;MLP和CNN模型 效果展示如下&#xff0c;很适合拿去组会汇报撑页数&#xff1a; 作业&#xff1a;对resnet18在cifar10上采用微调策略下&#xff0c;用tensorbo…...