上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 46 下一页

2020年2月4日

c连接redis

摘要: 1. 安装启动redis 2. 安装redis c语言客户端 #include <stdio.h> #include <stdlib.h> #include <hiredis.h> int main(int argc, char **argv) { // if (argc < 3) { // pri 阅读全文

posted @ 2020-02-04 16:23 luckygxf 阅读(1270) 评论(0) 推荐(0) 编辑

1108. IP 地址无效化

摘要: char * defangIPaddr(char * address){ if (address == NULL) return NULL; int addressLength = strlen(address); char *res = malloc(addressLength + 7); cha 阅读全文

posted @ 2020-02-04 14:35 luckygxf 阅读(126) 评论(0) 推荐(0) 编辑

1295. 统计位数为偶数的数字

摘要: int findNumbers(int* nums, int numsSize){ if (nums == NULL) return 0; int res = 0; for (int i = 0; i < numsSize; i++) { int tempNum = nums[i]; int dig 阅读全文

posted @ 2020-02-04 14:19 luckygxf 阅读(156) 评论(0) 推荐(0) 编辑

2020年2月3日

LCP 1. 猜数字

摘要: int game(int* guess, int guessSize, int* answer, int answerSize){ if (guess == NULL || answer == NULL) return 0; int res = 0; for (int i = 0; i < gues 阅读全文

posted @ 2020-02-03 11:24 luckygxf 阅读(138) 评论(0) 推荐(0) 编辑

1281. 整数的各位积和之差

摘要: int subtractProductAndSum(int n){ int sum = 0; int plus = 1; while (n > 0) { int mod = n % 10; sum += mod; plus *= mod; n = n / 10; } return plus - su 阅读全文

posted @ 2020-02-03 11:23 luckygxf 阅读(105) 评论(0) 推荐(0) 编辑

1313. 解压缩编码列表 - c

摘要: /** * Note: The returned array must be malloced, assume caller calls free(). */ int* decompressRLElist(int* nums, int numsSize, int* returnSize){ if ( 阅读全文

posted @ 2020-02-03 00:55 luckygxf 阅读(193) 评论(0) 推荐(0) 编辑

2019年12月27日

tar命令exclude使用

摘要: tar打包一个目录,想要排除掉某个文件夹,可以使用--exlude,不过位置不要放到最后 目录结构 run run/test run/test/test.txt 想打包run成run.tar.gz 排除掉test目录 使用tar -czf run.tar.gz run --exclude 报错 使用 阅读全文

posted @ 2019-12-27 00:14 luckygxf 阅读(2759) 评论(0) 推荐(0) 编辑

2019年12月25日

c消息队列

只有注册用户登录后才能阅读该文。 阅读全文

posted @ 2019-12-25 00:27 luckygxf 阅读(3) 评论(0) 推荐(0) 编辑

2019年12月16日

c线程使用锁控制并发

摘要: // // Created by gxf on 2019/12/16. // #include #include #include void increase_num(); int sharedi=0; pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; int main(){ pthread_t t1, t2, t3; ... 阅读全文

posted @ 2019-12-16 20:39 luckygxf 阅读(713) 评论(0) 推荐(0) 编辑

2019年12月13日

c多线程不加锁demo

摘要: // // Created by gxf on 2019/12/13. // #include <stdio.h> #include <stdlib.h> #include <pthread.h> int shareInt = 0; void increase_num(void); int main() { int ret; pthread_t thread1, thread2, thread3; 阅读全文

posted @ 2019-12-13 00:38 luckygxf 阅读(268) 评论(0) 推荐(0) 编辑

上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 46 下一页

导航