自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(13)
  • 收藏
  • 关注

原创 构造函数和析构函数以及他们之间错综复杂的关系

构造函数和析构函数以及他们之间错综复杂的关系

2023-12-27 15:10:37 351 1

原创 doxygen生成代码注释

【代码】doxygen生成代码注释。

2023-11-01 15:50:53 84 1

原创 remote: this repository, you must re-authorize the OAuth Application `GitHub for VS Code`.

remote: this repository, you must re-authorize the OAuth Application `GitHub for VS Code`.

2023-10-10 15:15:25 217 1

原创 git 免密登录/密钥失效/Missing or invalid credentials.

git 免密登录/密钥失效 Missing or invalid credentials.

2023-05-15 16:53:55 1725 1

原创 coredump文件生成

sudo systemctl disable apport.service //或。sudo systemctl enable apport.service //或。注意:对于ununtu并不起作用,需要关闭apport.service 服务。借助ulimit对shell资源以及shell创建的进程进行管理。一般会默认在当前目录生成,设置了路径后在路径生成。设置后即可生成coredump文件。

2023-04-11 21:37:35 604

原创 vscode创建c、c++环境,tasks.json和launch.json文件配置

vscode创建c、c++环境,tasks.json和launch.json文件配置

2022-07-25 22:56:54 2884

原创 c++ 智能指针的简单实现

手撕智能指针,emmmmmshow me the code#include <iostream>using namespace std;template<typename T>class smartPtr {private: T* _ptr; int* _count;public: smartPtr(T* ptr = nullptr) :_ptr(ptr), _count(new int(1)) { cout << "Constructor is

2021-09-04 16:54:14 99

原创 C++11 三个线程交替执行

三个线程会了的话,两个线程也会了吧。#include <iostream>#include <mutex>#include <condition_variable>#include <thread>using namespace std;mutex mtx;condition_variable cv;int flag = 0;int i=0;void print1(){ //unique_lock<mutex> ul

2021-08-31 14:11:42 247

原创 strlen和sizeof的区别

都是求字符串的长度strlen返回的是不包括’\0‘的长度sizeof返回的是包括’\0‘的长度

2021-05-15 17:21:42 68

原创 怎么判断大小端(网络字节序和主机字节序)

怎么判断大小端(网络字节序和主机字节序)判断方式使用union进行判断,这里说一下能用union判断的理由,union所占的字节数是union中成员的最大字节数,也就是说成员们共用同一块地址。#include<stdio.h>void byteOrder() { union { int data; char value[4]; }test; test.data = 0x0102; if (test.value[0] == 1 && test.value[1

2021-03-14 16:36:14 242

原创 C/C++两个线程交替执行

C/C++利用互斥锁和信号量实现两个线程交替执行

2020-12-18 15:48:41 2133 2

原创 strcasecmp和strncasecmp

int strcasecmp(const char *s1, const char *s2);int strncasecmp(const char *s1, const char *s2, size_t n);忽略大小写进行比较,差别是strncasecmp只比较s1的前n个字符。返回值:相等返回0,s1的长度小于s2返回负数,大于返回正数。The strcasecmp() function compares the two strings s1 and s2, ignoring the case

2020-11-10 19:34:24 132

原创 生产者消费者模型代码实现 c/c++

生产者消费者模型代码--互斥量加信号量实现

2020-10-30 19:38:54 905 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除