- 博客(15)
- 资源 (26)
- 收藏
- 关注
原创 Linux:通过域名,获取IP地址<gethostbyname>函数使用
Linux:通过域名,获取IP地址参考链接:https://blog.csdn.net/qq_21794823/article/details/53068351https://blog.csdn.net/daiyudong2020/article/details/51946080源码:#include <stdio.h>#include <string.h>...
2019-07-31 19:10:55 901 1
原创 C语言:main函数参数
#include <stdio.h>#include <string.h>int main(int argc, char **argv){ if(2 != argc) { printf("Not Found Param ! \n"); return -1; } printf("argc : %d \n", argc); int i; ...
2019-07-31 19:06:10 129
原创 C语言:简单排序:冒泡/简单选择/直接插入
#include <stdio.h>#include <string.h>#include <stdlib.h>#include <stdbool.h>int swap(int *a, int *b){ int c; c = *a; *a = *b; *b = c;}int Print(int buf[], int len)...
2019-07-29 22:31:19 153
原创 LeetCode :初级算法_[数组]: 旋转数组(C语言实现)
LeetCode :初级算法_[数组]:从排序数组中删除重复项题目地址:https://leetcode-cn.com/explore/featured/card/top-interview-questions-easy/1/array/23/描述:给定一个数组,将数组中的元素向右移动 k 个位置,其中 k 是非负数。示例 1:输入: [1,2,3,4,5,6,7] 和 k ...
2019-07-28 23:54:45 370
原创 LeetCode :初级算法_[数组]:从排序数组中删除重复项 (C语言实现)
LeetCode :初级算法_[数组]:从排序数组中删除重复项题目地址:https://leetcode-cn.com/explore/featured/card/top-interview-questions-easy/1/array/21/描述:给定一个排序数组,你需要在原地删除重复出现的元素,使得每个元素只出现一次,返回移除后数组的新长度。不要使用额外的数组空间,你必须在原...
2019-07-26 23:51:46 176
原创 报错:error: expected ‘;’, ‘,’ or ‘)’ before ‘mutex’
报错如下: error: expected ‘;’, ‘,’ or ‘)’ before ‘mutex’ int InitMutex(pthread_mutex_t *restrict mutex); ^error: expected ‘;’, ‘,’ or ‘)’ before ‘rwlock’ int InitRwlock(pthread_rwlock_t *restrict r...
2019-07-24 19:47:39 432
原创 Windwos :获取VirtualBox COM对象失败
安装了Oracle VM VirtualBox 后,双击打开该应用报错。报错如下图所示:解决方法:参考连接:https://forums.virtualbox.org/viewtopic.php?f=6&t=80448如下图,多人证明该方法可行。下面介绍详细操作:1、使用win+R打开"运行窗口",在运行窗口输入regedit打开windows系统的注册表...
2019-07-20 21:40:54 448
原创 线程(五):pthread_detach不会阻塞等待线程结束
#include <stdio.h>#include <string.h>#include <pthread.h> /*创建线程头文件*/static pthread_t pid;void *pfun(){ while(1) { printf("---- \n"); sleep(1); } }int main(){ int r...
2019-07-16 19:50:16 692
原创 Linux:显示安装包的安装情况:aptitude show 命令
使用aptitude show命令可以查看安装包的安装情况:root@ubuntu:~# aptitude show vim软件包: vim 状态: 已安装自动安装: 否版本号: 2:7.4.052-1ubuntu3.1优先级: 可选部分: editors维护者: Ubuntu Developers <ubuntu-devel-disc...
2019-07-13 23:30:33 1827
原创 Linux:内核环形缓存区kfifo使用
内核环形缓存区kfifo使用学习C语言的人有时候会问,去哪里看大佬写的代码,然后自己消化学习。其实优秀的代码就在你身边:Linux内核。里面有顶级大师的手笔,有对C语言特性发挥到极致的应用。没有秀一些冷门的知识,只用大家都熟知的特性,就可以完成牛逼的功能。最近项目用到了环形缓存区的功能,是典型的消费者和生产者问题。所以想到了内核中的fifo。想直接把内核中需要的代码拿过来,用到自己的代...
2019-07-12 19:52:57 1920 1
原创 Notepad++快捷键汇总
主要是自己一直使用的快捷键总结。其中有系统自带的,也有自己修改的 在 设置->管理快捷键 : "注释/取消注释"相关: "折叠/展开"相关: "查找/替换/跳转"相关: 复制当前行: 删除当前行:删除当前行,是定义的宏。设置过程,参考:https://blog.csdn.net/wxuzero/article/details/790230...
2019-07-10 21:40:39 1093
原创 Linux:fd_set 结构体定义及使用
在使用select函数时,fd_set结构体是很重要的。想正确使用select函数,理解fd_set是必不可少的。<sys/select.h>下面给出<sys/select.h>头文件的全部内容:/* `fd_set' type and related macros, and `select'/`pselect' declarations. Copyright...
2019-07-09 19:22:36 8259
原创 线程(四):pthread_attr_setstacksize设置线程堆栈大小
pthread_attr_setstacksize可以设置线程堆栈大小,用法: pthread_t thread; int ret; pthread_attr_t thread_attr; pthread_attr_init(&thread_attr); pthread_attr_setstacksize(&thread_attr, 256*1...
2019-07-08 19:36:29 7012
原创 线程(三):pthread_attr_setdetachstate 函数用法
用法:pthread_t tid;pthread_attr_t attr;pthread_attr_init(&attr);pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);pthread_create(&tid, &attr, THREAD_FUNCTION, arg);设...
2019-07-08 19:35:34 5662
原创 线程(二):线程/线程锁相关的函数原型
/* int pthread_mutex_init(pthread_mutex_t *restrict mutex, const pthread_mutexattr_t *restrict attr); */ /* int pthread_rwlock_init(pthread_rwlock_t *restrict rwlock, const pthread_rwlock...
2019-07-08 19:34:08 376
0905_build_no_gcc_ser.log
2020-09-06
mpfr-3.1.5.tar.gz
2020-07-30
mpc-0.9.tar.gz
2020-07-30
translations_ts.tar.gz
2019-12-06
translations_qm.tar.gz
2019-12-06
JT//T 1076——2016
2019-02-21
JT//T 1078——2016
2019-02-21
JT / T 794—2011
2019-02-21
TortoiseSVN-1.8.12.26645-x64-svn-1.8.14
2018-11-28
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人