
C/C++
文章平均质量分 77
Thinkcortex
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
警告:计算出的值未被使用warning: value computed is not used [-Wunused-value]
gcc 编译警告 warning: value computed is not used [-Wunused-value] #include <stdio.h> int fun(int *data) { *data ++; return 0; } int main() { int a = 3; fun(&a); printf("...原创 2019-12-30 17:20:11 · 9678 阅读 · 1 评论 -
c语言 #define 中"##" 的作用
define 中的##用来连接 ## 之前和之后的内容 #define aaa(arg) hello_ ## arg int main(void) { int hello_i = 11; printf("hello world, %d\n", aaa(i)); return 0; } 预处理后: int main(void) ...原创 2019-12-20 10:29:02 · 1303 阅读 · 0 评论 -
拆轮子之redis list
这里用的是redis5.0.5 在不修改源文件的情况下,拷贝以下文件: adlist.c adlist.h atomicvar.h config.h mytest zmalloc.c zmalloc.h 编写测试代码: #include <stdio.h> #include "adlist.h" #include "zmalloc.h" void *m...原创 2019-10-12 17:36:31 · 256 阅读 · 0 评论 -
128位二进制数字加减
#include <stdio.h> #include <stdint.h> #include <arpa/inet.h> void ipv6_addition(unsigned char *ipaddr, int n) { uint32_t *p = (uint32_t *)ipaddr; int64_t tmp = 0, tmp2 = 0...原创 2018-08-20 09:24:59 · 1772 阅读 · 0 评论 -
c 链表
#ifndef HS_LLIST_H #define HS_LLIST_H #define LLIST_FORWARD 1 #define LLIST_BACKWARD 2 struct llist_node_st { struct llist_node_st *prev; struct llist_node_st *next; c...原创 2018-08-31 18:27:33 · 1498 阅读 · 0 评论