- 博客(10)
- 资源 (1)
- 收藏
- 关注
原创 linux 静态库,动态库编译
静态库编译例子:源文件fun.cppgcc -c fun.cpp 生成 fun.oar rcsv libname.a fun.o // 生成静态库libname.a具体ar命令参数可查看帮助文档动态库编译gcc -fPIC -c fun.c // 生成 fun.ogcc -shared -o libname.so fun.o // 或者使用 ar crv libname.so fun.o可合并成一行: gcc -fPIC -shared -o libname.
2022-04-10 20:52:22 375
原创 字节序转换
通过多次位移与&|操作实现高低字节序转换#define SWAP16_(s) ((((s)&0xff)<<8)|(((s)>>8)&0xff))#define SWAP16(s) SWAP16_(uint16_t(s))////ntohl//#define SWAP32(l) ntohl(l)#define SWAP32_(l) (((l)>>24) |\(((l)&0x00ff0000)>>8) ..
2021-10-22 15:49:58 343
原创 linux执行命令
std::pair<bool, string> exeShellCmds(const string &cmd, std::vector<string> &results){#ifdef _linux_ int bufferSize = 1024; char *buffer = new char[bufferSize]; FILE *pFile = nullptr; std::string cmds = cmd; cmds.append(" &am..
2021-02-24 10:26:57 112
转载 RSA 加密解密
#include "randpool.h" #include "rsa.h" #include "hex.h" #include "files.h" using namespace std; using namespace CryptoPP; //#pragma comment(lib, "cryptlib.li...
2020-04-03 13:32:51 219
转载 RSA
/** MyRSA.h** Created on: 2013-3-7* Author: wzb*/#ifndef MYRSA_H_#define MYRSA_H_#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1#include <iostream>#include <string>#inclu...
2020-04-01 14:17:14 93
转载 mysql 窗口函数
从version 8.0开始,MySQL支持在查询中使用窗口函数。CREATE TABLE sales( sales_employee VARCHAR(50) NOT NULL, fiscal_year INT NOT NULL, sale DECIMAL(14,2) NOT NULL, PRIMARY KEY(sales_employee,fiscal_yea...
2020-03-24 21:38:31 106
原创 mysql
#include <stdlib.h>#include <stdio.h>#include "mysql.h"int main(int argc,char *argv[]) { MYSQL *conn_ptr; conn_ptr = mysql_init(NULL); if(!conn_ptr) ...
2020-03-21 12:37:52 83
原创 epoll_pwait
http://man7.org/linux/man-pages/man2/epoll_wait.2.html #include <sys/epoll.h> int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout); ...
2020-03-20 14:08:55 2467
原创 vim tab设置为4个空格
修改home目录下 ~/.vimrc 添加如下配置set tabstop=4set expandtabset autoindent
2020-03-20 12:59:20 65
c++11新特性解析与应用.pdf
2017-02-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人