avatar
文章
79
标签
21
分类
15
Home
Archives
Categories
Tags
Hymns058-design-patterns-learning
搜索
Home
Archives
Categories
Tags

058-design-patterns-learning

发表于2024-11-28|更新于2024-11-29|learning
|浏览量:

设计模式

网站

  • refactoringguru 设计模式
  • 图说设计模式
  • GeeksforGeeks 设计模式

视频

  • 设计模式-阿西拜编程

GitHub

  • design-patterns-for-humans
  • design-patterns-cpp
文章作者: Hymns
文章链接: https://hmmmmmya.github.io/2024/11/28/058-design-patterns-learning/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Hymns!
上一篇
059-int赋值给char
int 直接赋值给 char 会怎么样在 C++中,将一个 int 类型的值直接赋值给一个 char 类型的变量时,可能会发生以下情况: 截断:char 类型通常是 1 字节(8 位),而 int 类型通常是 4 字节(32 位)或更多。因此,当 int 的值超出 char 的表示范围时,只有最低的 8 位会被保留,其余的位会被截断。这可能导致数据丢失或值的改变。 符号扩展:如果 char 是有符号的(signed char),并且 int 的值超出了 char 的正数范围(通常是 -128 到 127),则可能会导致符号扩展问题,导致负值。 未定义行为:如果 int 的值超出了 char 的表示范围,可能会导致未定义行为,具体表现取决于编译器和平台。 例如: 12int largeValue = 300;char smallValue = largeValue; // smallValue 可能会变成 44,因为 300 的最低 8 位是 44 为了避免这些问题,通常建议在赋值前进行显式的类型转换,并确保值在目标类型的范围内: 12int largeValue =...
下一篇
057-nlohmann_json库的使用
json.hpp 库下载及安装nlohmann json 的开源项目地址: https://github.com/nlohmann/json#serialization–deserialization 对于我们项目中要使用 nlohmann json 工具,只需要引入 json.hpp 这一个文件,其中包含所有接口函数,正如其文档中所述 json.hpp 文件在 single_include/nlohmann 目录下,我们只需要下载该文件即可: git clone https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp 注意:不是 include/nlohmann/json.hpp,而是 single_include/nlohmann/json.hpp,前者要包含整个文件夹,后者只需要包含 json.hpp 文件。 用 json 赋值在使用 nlohmann JSON 库时,如果 JSON...
avatar
Hymns
文章
79
标签
21
分类
15
Follow Me
公告
This is my Blog
目录
  1. 1. 设计模式
    1. 1.1. 网站
    2. 1.2. 视频
    3. 1.3. GitHub
最新文章
079-ClouDNSandCloudflare_mailtransfer2025-03-20
078-vscode搜索最大显示19999+2025-03-06
077-cpp类成员变量的声明顺序2025-02-28
076-格式化字符串参数2025-02-26
075-排序算法2025-02-12
©2024 - 2025 By Hymns
框架 Hexo|主题 Butterfly
搜索
数据加载中