![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
凉水河畔
这个作者很懒,什么都没留下…
展开
-
内存对齐详细
CacheLine对齐_「已注销」的博客-CSDN博客_cache line对齐内存对齐c++ 内存对齐那些事_lq_fly_pig的博客-CSDN博客转载 2022-07-07 17:51:29 · 108 阅读 · 0 评论 -
八皇后递归算法
多的废话就不说了直接上代码#include <iostream>//规则//在8x8的棋盘内放置八个皇后,并且保证每个皇后是安全的。//分析//每个皇后必须单独一行,用一个数组来表示她们所在列的位置,下标代表所在行的位置。int aQueen[8] = { 0,0,0,0,0,0,0,0 };//储存记过bool analyzePoint(int x, int y)//规则检测,检测当前位置是否和已有位置冲突{ for (auto i = 0; i < x; i++原创 2021-03-02 11:28:48 · 148 阅读 · 0 评论 -
wstring和string相互转换
wstring to stringstd::string stows(std::wstring& ws){ std::string curLocale = setlocale(LC_ALL, NULL); // curLocale = "C"; setlocale(LC_ALL, "chs"); const wchar_t* _Source = ws.c_str(); size_t _Dsize = 2 * ws.size() + 1; char *_Dest = new char[_原创 2020-07-10 15:43:26 · 1284 阅读 · 0 评论 -
C++ static 详解
参考地址:https://blog.csdn.net/MoreWindows/article/details/6721430转载 2019-07-27 19:52:04 · 120 阅读 · 0 评论 -
最简单的vector结合tuple声明赋值取值操作
vector结合tuple是怎么的声明,赋值,和取值。还有一段使用opencv计算广义逆矩阵的方法。#include <tuple>#include <set>#include <iostream>#include <string>#include <vector>#include "opencv2/opencv.hpp"...原创 2019-07-27 11:26:51 · 2188 阅读 · 0 评论 -
C++ map的赋值和取值
c++的map中通过key获取value的方法一般是value =map[key],或者另一种迭代器的方式1、在map中,由key查找value时,首先要判断map中是否包含key。2、如果不检查,直接返回map[key],可能会出现意想不到的行为。如果map包含key,没有问题,如果map不包含key,使用下标有一个危险的副作用,会在map中插入一个key的元素,value取默认值,返回...转载 2019-07-26 18:39:54 · 40667 阅读 · 0 评论 -
C++连接mysql CURD
C++连接数据库并查询数据表person:person数据表: #include <string>#include <stdio.h>#include <iostream>#include <mysql.h>using namespace std;int main() { MYSQL mysql; mysql_...原创 2019-08-03 11:51:58 · 192 阅读 · 0 评论 -
C++ Segmentation Fault错误原因总结
https://blog.csdn.net/u010150046/article/details/77775114转载 2019-07-30 17:39:54 · 22151 阅读 · 0 评论 -
cmake实战
链接:https://www.hahack.com/codes/cmake/转载 2019-07-17 23:22:13 · 115 阅读 · 0 评论 -
C++分割字符串
参数说明:strSrc 传入字符串strDelims 分割的标识strDest 字符串数组返回值:数组的长度int splitString(const string & strSrc, const std::string& strDelims, vector<string>& strDest) { typedef std::string::s...转载 2019-07-17 17:42:51 · 242 阅读 · 0 评论