上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 37 下一页
摘要: 演示环境: win10 + vs2015 (下面简称VS)+ visual assist (下面简称VA) 1、混乱 装了VA的VS,有个快捷键,可快速切换 .h 文件和 .cpp(.cc, .cxx) : alt+o. 但是,有时候按错键: 将 alt + o 错按位 alt + p . 额, 意 阅读全文
posted @ 2020-09-15 10:22 mohist 阅读(1116) 评论(0) 推荐(0) 编辑
摘要: 持续更新: 1、c++11自己实现的 信号量 和 事件 头文件.h 1 #pragma once 2 #include <mutex> 3 #include <condition_variable> 4 #include <chrono> 5 6 7 namespace utils 8 { 9 cl 阅读全文
posted @ 2020-09-13 13:21 mohist 阅读(584) 评论(0) 推荐(0) 编辑
摘要: 【本文可能涉及到Ubuntu安装以下工具:】 A、g++ B、gcc C、make D、cmake E、clang(10.0.1)(必须) F、llvm(10.0.1)(必须) G、lldb(10.0.1)(可选) H、libcxx(10.0.1)(必须) I、libcxx abi(10.0.1)( 阅读全文
posted @ 2020-09-12 01:46 mohist 阅读(5226) 评论(0) 推荐(0) 编辑
摘要: 概述 本文演示环境: win10 + VS2017 1.指定变量值 咱们常用命令【cmake ..】在build目录下配置生成项目和解决方案。 其实,这个命令还有其他用法。 指定CMakeLists.txt中的变量值。比如 , fmt 库 的CMakeLists.txt中有一个变量 【BUILD_S 阅读全文
posted @ 2020-09-10 12:25 mohist 阅读(14274) 评论(1) 推荐(0) 编辑
摘要: 本文主要介绍 std::chrono日期和时间用法。 演示环境: vs2017 0、头文件 1 #include <chrono> 2 #include <thread>// 如果需要使用线程 1、duration 其表示一段时间,可以是这段时间单位可以是秒、分钟、小时、微秒,可以在 这里 看到详情 阅读全文
posted @ 2020-09-09 10:38 mohist 阅读(1566) 评论(0) 推荐(0) 编辑
摘要: 下载网易云音乐的视频 https://yunyinyue.iiilab.com/ 模板教程: https://github.com/wuye9036/CppTemplateTutorial/blob/master/ReadMe.md 1、http://www.zhangxinhao.com/myno 阅读全文
posted @ 2020-09-08 13:24 mohist 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 元组,c++11中引入的新的类型,可类比std::pair。 但是std::pair只能支持两个元素。 理论上, 元组支持0~任意个元素。 本文演示环境: VS2015 up3 0、头文件 #include <tuple> 1、创建和初始化 1.1、创建一个空的元组, 创建时,需要指定元组的数据类型 阅读全文
posted @ 2020-09-08 09:20 mohist 阅读(36156) 评论(1) 推荐(3) 编辑
摘要: 本文将使用 泛型 实现可变参数。 涉及到的关见函数: std::snprintf 1、一个例子 函数声明及定义 1 // 泛型 2 template <typename... Args> 3 std::string show_str(const char *pformat, Args... args 阅读全文
posted @ 2020-09-07 22:55 mohist 阅读(3795) 评论(0) 推荐(0) 编辑
摘要: 0、序言 使用printf函数,其参数就是可变参数。下面将使用 C语言 的库函数实现可变参数的函数 。 用途(欢迎补充): A、记录日志,可能需要将变量格式化输出到日志文件。 B、格式化字符串,显示结果(A差不多)。 1、使用 A、头文件 // 使用va_start需要的头文件 #include < 阅读全文
posted @ 2020-09-07 22:30 mohist 阅读(1511) 评论(0) 推荐(0) 编辑
摘要: 0、序言 变长参数,接触的第一个可变长参数函数是 printf , 然后是 scanf 。他们的原型如下: printf: _Check_return_opt_ _CRT_STDIO_INLINE int __CRTDECL printf( _In_z_ _Printf_format_string_ 阅读全文
posted @ 2020-09-07 21:28 mohist 阅读(321) 评论(0) 推荐(0) 编辑
上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 37 下一页