
C++基础
wwwsctvcom
这个作者很懒,什么都没留下…
展开
-
VC2019配置Onnxruntime和OpenCV环境
一、环境配置0、配置Debug或Release模式1、配置包含目录:D:\openvino\openvino_2021.4.689\opencv\include和D:\onnxruntime\include2、设置Windows运行库目录D:\onnxruntime\lib和D:\openvino\openvino_2021.4.689\opencv\lib3、配置附加依赖项:D:\openvino\openvino_2021.4.689\opencv\lib\*.l原创 2022-02-19 16:49:25 · 4350 阅读 · 1 评论 -
clion配置opencv环境
因为安装教程在网上已经很多了Windows10 环境下使用 Cmake 和 MinGW-w64 编译安装 OpenCV 4.0.1_木偶不哭不笑的博客-优快云博客这里主要在这里记录两个出现过的报错:(主要是因为python环境为python2,建议使用anaconda的python3问题会少很多)报错1:(python安装目录)\include\pyconfig.h下添加#define MS_WIN64报错2:mingw安装目录下mingw64\lib\gcc\x86_64-w64-min原创 2021-11-10 23:13:14 · 3355 阅读 · 0 评论 -
多线程下fwrite和write是否线程安全问题
一、代码#include <fcntl.h>#include <pthread.h>#include <stdio.h>#include <string.h>#define USE_CLIB#define LOOPS 1000000#ifdef USE_CLIBstruct thr_data { FILE *fp; const char *data;};static void *write_data(void *d原创 2021-08-13 15:32:56 · 1440 阅读 · 0 评论 -
C++中多线程对同一文件的读写
一、product内未加锁,在for循环内进行join1、代码#include <fstream>#include <pthread.h>using namespace std;pthread_mutex_t file_mutex;void* product(void* args){// pthread_mutex_lock(&file_mutex); ofstream file; file.open("file.txt", ios::app);原创 2021-08-13 10:09:59 · 3955 阅读 · 0 评论 -
GoogleTest系列:TEST_P的基本用法
一、代码部分#include <gtest/gtest.h>class Bis {public: bool Even(int n) { if (n % 2 == 0) { return true; } else { return false; } }; bool Suc(bool bSuc)原创 2021-07-28 10:42:18 · 6148 阅读 · 0 评论 -
C++四种类型转换运算符:static_cast、dynamic_cast、const_cast和reinterpret_cast
一、前言refrenced link:http://c.biancheng.net/cpp/biancheng/view/3297.html原创 2021-07-26 09:55:31 · 135 阅读 · 0 评论 -
IDEA/Clions/AndroidStudio编辑器格式设置
一、序言git检查代码格式的时候会有一定的要求,不同公司有不同的要求,下面介绍一些常用的设置格式的方法。二、设置格式File中Settings1、设置每行最大字符数为80原创 2021-05-20 21:45:09 · 836 阅读 · 0 评论 -
c++中指针和引用的简单区分
#include <iostream>using namespace std;void func1(int& ref){ ref = 100;}void func2(int* ref){ *ref = 200;}void func3(int ref){ ref = 300;}int main() { int a = 2; //指针常量: int* const ref = &a, 代表指针指向不可改变; in.原创 2021-03-10 15:44:15 · 110 阅读 · 0 评论 -
c语言中创建线程与线程锁
#include <stdio.h>#include <pthread.h>#include <windows.h>#define MAX_COUNT 10000int count = 0;pthread_mutex_t mutex_lock;void* counter1(void* args){ int i = 1; while(i <= MAX_COUNT/4){ pthread_mutex_lock(&.原创 2021-03-10 14:02:45 · 482 阅读 · 0 评论 -
c++预处理器
#include <iostream>using namespace std;int main(){#define PI 3.1415 cout << PI << endl;#define DEBUG#ifdef DEBUG cerr << "Debug" << endl;#endif // DEBUG#if 0 //注释功能; cout << "comment" << endl;#end.原创 2020-12-25 11:32:50 · 119 阅读 · 0 评论 -
C++ STL基本介绍和使用
#include <array>#include <vector>#include <queue>#include <map>#include <unordered_map>#include <utility>#include <set>#include <unordered_set>#include <tuple>#include <iostream>using .原创 2020-12-25 10:56:48 · 130 阅读 · 0 评论