自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

原创 多线程控制互斥锁与信号量

1.多线程编临界资源访问#define _GNU_SOURCE #include <pthread.h>#include <stdio.h>#include <unistd.h>#include <errno.h>int Num = 0;void *fun1(void *arg){ while(Num<3){ Num++; printf("%s :Num =

2020-11-16 16:13:50 163

原创 多线程创建、退出与回收

1.在程序中,可以通过函数,pthread_self,来返回当前线程的线程号,例程1给出了打印线程tid号获取线程号#include <pthread.h>pthread_t pthread_self(void);成功:返回线程号#include <stdio.h>#include <pthread.h>int main(){ pthread_t tid = pthread_self(); printf("tid = %ld

2020-11-16 13:56:22 495

原创 UDP编程

服务端代码:#include <sys/types.h> /* See NOTES */#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <unistd.h>#include <stdio.h>#include <errno.h>#include <time.h>#in...

2020-11-15 18:01:15 53

原创 读老文件到新文件

#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <unistd.h>#include <stdio.h>int main(int argc,char **argv){ int fd_old,fd_new; char buf[1024]; int len; /* 1. 判断参数 */

2020-11-15 10:57:10 127

原创 设置环境变量PATH

1.如果不想设置环境变量echo $PATHsudo cp hello /usr/local/bin/hello2hello22.临时设置环境变量(只对当前终端有效)cp hello /home/book/export PATH= $PATH:/home/book3.永久设置方法(对当前用户有效)修改~/.bashrc vi ~/.bashrc在行尾添加: export PATH=$PATH:/home/book然后重启系统或重新登录4.永..

2020-11-14 13:43:47 245

原创 Makefile规则与示例

1.Makefiletest : main.c sub.c sub.hgcc -o tset main.c sub.c2.Makefiletest : main.o sub.ogcc -o test main.o sub.cmain.o : main.cgcc -c -o main.o main.csub.o : sub.cgcc -c -o sub.o sub.cclean:rm *.o test -f执行:make make clean3.Makefiletest ..

2020-11-13 10:21:55 140

原创 linux常用的压缩命令

2020-11-12 13:43:04 56

原创 linux进阶命令

2020-11-11 21:39:48 81

原创 vi常用命令

:%s/p1/p2/gc 全局替换 替换需确认 n下一个:%s/p1/p2/g

2020-11-11 21:07:17 65

原创 基于Wemos的wifi避障小车

#include <ESP8266WiFi.h>#define Dong1 D6#define Dong2 D7#define Zhuan1 D4#define Zhuan2 D5#define Echo D2#define Trig D8char* ssid = "HONOR9X"; //“wifi热点名称”char* passwd = "qwejklbnm"; //”wifi热点密码”int port

2020-11-10 18:37:35 245

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除