随笔分类 -  C/C++

C/C++ 相关学习及应用
摘要:0.0 扉页 项目主页 Google Style Guide Google 开源项目风格指南 -中文版 0.1 译者前言 Google 经常会发布一些开源项目, 意味着会接受来自其他代码贡献者的代码. 但是如果代码贡献者的编程风格与 Google 的不一致, 会给代码阅读者和其他代码提交者造成不小的 阅读全文
posted @ 2021-03-30 18:57 Xu_Lin 阅读(428) 评论(0) 推荐(0) 编辑
摘要:#1.3 链表 ##1.3.1 头插法建立单链表 #include <stdio.h> #include <stdlib.h> typedef char datatype; typedef struct node{ datatype data; struct node *next; } listno 阅读全文
posted @ 2021-03-03 17:15 Xu_Lin 阅读(315) 评论(0) 推荐(0) 编辑
摘要:对多个值取最值 C++标准库提供了获取最大值和最小值的方法: int mi = std::min(x1, x2); int ma = std::max(x1, x2); 如果想获取超过两个数的最值呢? 可以使用嵌套的方法,比如这样: int mi = std::min(x1, std::min(x2 阅读全文
posted @ 2021-03-02 11:52 Xu_Lin 阅读(294) 评论(0) 推荐(0) 编辑
摘要:// 最基本实现 template<typename T> static void print(T t) { std::cout << t; } // 处理 std::pair template<typename Kt, typename Vt> static void print(std::pai 阅读全文
posted @ 2021-03-02 11:28 Xu_Lin 阅读(372) 评论(0) 推荐(0) 编辑
摘要:#include <sstream> #include <iostream> #include <iomanip> using namespace std; /** * 四舍五入保留到n位小数 * @param number * @param bits * @return */ static dou 阅读全文
posted @ 2020-10-30 10:35 Xu_Lin 阅读(546) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <string> using namespace std; /** * 截取str后的元素 * @param stream 待截取字符串 * @param str 截取定位字符串 * @return */ static auto cutNex 阅读全文
posted @ 2020-09-26 11:51 Xu_Lin 阅读(7129) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <vector> #include <algorithm> #include <set> using namespace std; /** * vector去除重复元素 * @tparam T * @param result * @retur 阅读全文
posted @ 2020-09-23 11:27 Xu_Lin 阅读(2755) 评论(0) 推荐(0) 编辑
摘要:// // Created by leoxae on 2020/3/30. // #include "BarCodeRecogntion.h" string BarCode::BarCodeRecognition(Mat image) { string result; zbar::ImageScan 阅读全文
posted @ 2020-03-30 16:46 Xu_Lin 阅读(195) 评论(0) 推荐(0) 编辑
摘要:Effective C++ 视C++ 为一个语言联邦(C、Object-Oriented C++、Template C++、STL) 宁可以编译器替换预处理器(尽量以const、enum、inline替换#define) 尽可能使用const 确定对象被使用前已先被初始化(构造时赋值(copy 构造 阅读全文
posted @ 2020-03-25 15:29 Xu_Lin 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-12-09 15:41 Xu_Lin 阅读(2768) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-11-15 15:41 Xu_Lin 阅读(588) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-11-14 11:18 Xu_Lin 阅读(497) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-11-14 11:16 Xu_Lin 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-11-14 11:15 Xu_Lin 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-11-14 11:13 Xu_Lin 阅读(295) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <thread> #include <mutex> #include <iostream> // std::cout, std::endl #include <future> // std::async, std::future #inclu 阅读全文
posted @ 2019-11-07 16:57 Xu_Lin 阅读(272) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-11-06 13:54 Xu_Lin 阅读(840) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-11-04 17:44 Xu_Lin 阅读(1333) 评论(0) 推荐(0) 编辑