随笔分类 - C/C++
摘要:class MyClassA { public: MyClassA():b(new char[12]) { memset(b, 0, 12); strcpy(b,"hello"); cout << "构造" << endl; } ~MyClassA() { if (b) { cout << "析构"
阅读全文
摘要:typedef struct nodes_t { int data; struct nodes_t* next; }nodes_t; static nodes_t* head_point = NULL; nodes_t* createNode(nodes_t *node) { nodes_t *p1
阅读全文
该文被密码保护。
摘要:给定一个非负整数数组,你最初位于数组的第一个位置。 数组中的每个元素代表你在该位置可以跳跃的最大长度。 你的目标是使用最少的跳跃次数到达数组的最后一个位置。 示例: 输入: [2,3,1,1,4] 输出: 2 解释: 跳到最后一个位置的最小跳跃数是 2。 从下标为 0 跳到下标为 1 的位置,跳 1
阅读全文
摘要:#define ALIGNMENT 8 // 内存对齐:将size向上对齐到最近的ALIGNMENT倍数 static size_t align_size(size_t size) { if(size==0) return ALIGNMENT; // 对齐公式:(size + 对齐数 - 1) &
阅读全文
摘要:void *Memcpy(void *dest, const void *src, size_t count) { cout<<"sizeof(dest)是:"<<sizeof(dest)<<endl; int bytelen=count/sizeof(dest); /*按CPU位宽拷贝*/ int
阅读全文
摘要:https://github.com/guanzhi/GmSSL?tab=readme-ov-file
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> #include <string.h> #include <openssl/aes.h> #include <openssl/rand.h> #include <openssl/evp.h> #include <opens
阅读全文
该文被密码保护。
摘要:#include <openssl/evp.h> #include <openssl/asn1.h> // 从PKCS8编码中获得公钥 int lbxx_pkcs8_d2i_sm2_pubkey(unsigned char* pucDer, unsigned int puiLen, unsigned
阅读全文

浙公网安备 33010602011771号