- 博客(13)
- 收藏
- 关注
原创 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
508
1
原创 git 免密登录/密钥失效/Missing or invalid credentials.
git 免密登录/密钥失效 Missing or invalid credentials.
2023-05-15 16:53:55
2372
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
731
原创 vscode创建c、c++环境,tasks.json和launch.json文件配置
vscode创建c、c++环境,tasks.json和launch.json文件配置
2022-07-25 22:56:54
3486
原创 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
133
原创 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
293
原创 怎么判断大小端(网络字节序和主机字节序)
怎么判断大小端(网络字节序和主机字节序)判断方式使用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
287
原创 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
168
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人