会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
gǒが油メo
博客园
首页
新随笔
联系
订阅
管理
2023年3月13日
assert案例
摘要: 1. 正常 #include <assert.h> int main(){ int i = 0; assert(i == 0); //判断为真,程序正常退出 return 0;} 2. 异常 #include <assert.h> int main(){ int i = 1; assert(i ==
阅读全文
posted @ 2023-03-13 17:11 gǒが油メo
阅读(23)
评论(0)
推荐(0)
2022年9月13日
make 报错:error: cast from ‘int32_t*’ {aka ‘int*’} to ‘int’ loses precision [-fpermissive]
摘要: 错误提示: xxx.h:117:59: error: cast from ‘int32_t*’ {aka ‘int*’} to ‘int’ loses precision [-fpermissive] int m_MinValidLen = (int)(&(((DataOnAir *)0)->rx_
阅读全文
posted @ 2022-09-13 17:10 gǒが油メo
阅读(608)
评论(0)
推荐(0)
make警告:control reaches end of non-void function [-Wreturn-type] }
摘要: 错误警告事例: bool test() { printf("test\n"); } 修改: bool test() { printf("test\n"); return true; //加上返回值解除警告 }
阅读全文
posted @ 2022-09-13 17:02 gǒが油メo
阅读(179)
评论(0)
推荐(0)
2022年8月23日
pthread_once()函数详解
摘要: 函数声明: int pthread_once(pthread_once_t *once_control, void (*init_routine) (void)); 本函数使用初值为PTHREAD_ONCE_INIT的once_control变量保证init_routine()函数在本进程执行序列中
阅读全文
posted @ 2022-08-23 10:37 gǒが油メo
阅读(309)
评论(0)
推荐(0)
2022年8月17日
C++获取线程标识符id(线程号)
摘要: 头文件:<thread> 方法1:获取指定线程的线程id std::thread::id 方法2:获取当前线程的线程id std::this_thread::get_id() 案例解析: void foo() { while (1) { std::cout << "std::this_thread:
阅读全文
posted @ 2022-08-17 11:07 gǒが油メo
阅读(6302)
评论(0)
推荐(0)
2022年7月18日
Centos7 cmake 版本升级(由 v2.8.12.2 升级至 v3.16.6)
摘要: ## 1. 查看当前cmake版本[root@localhost ~]# cmake -versioncmake version 2.8.12.2## 2. 进行卸载[root@localhost ~]# yum remove -y cmake## 3. 进行安装包的下载,也可以下载好安装包后传至相
阅读全文
posted @ 2022-07-18 10:54 gǒが油メo
阅读(1027)
评论(0)
推荐(0)
2022年7月14日
&((struct s*)0)->d的相关详解
摘要: #include <stdio.h> struct s{ int a; int b; int c; char d;};void main(){ printf("%d",&((struct s *) 0)->a); //把结构体s的起始位置视为0,返回结构体s的成员a的位置【输出结果为0】 print
阅读全文
posted @ 2022-07-14 11:15 gǒが油メo
阅读(500)
评论(0)
推荐(0)
2022年6月17日
cfsetispeed和cfsetospeed函数---波特率设置;cfgetispeed和cfgetospeed函数---获取波特率信息;tcflush函数
摘要: 头文件:#include <termios.h> 函数原型:int cfsetispeed(struct termios *termptr, speed_t speed); int cfsetospeed(struct termios *termptr, speed_t speed); int cf
阅读全文
posted @ 2022-06-17 17:13 gǒが油メo
阅读(2893)
评论(0)
推荐(0)
tcgetattr函数和tcsetattr函数----终端控制介绍与使用
摘要: 1. tcgetattr函数 头文件:#include <termios.h> 函数原型:int tcgetattr(int fd, struct termios *termios_p); 说明:tcgetattr函数用于获取与终端相关的参数。参数fd为终端的文件描述符,返回的结果保存在termio
阅读全文
posted @ 2022-06-17 16:02 gǒが油メo
阅读(786)
评论(0)
推荐(0)
2022年6月10日
setjmp函数的简单理解
摘要: 需要在函数内部进行跳转可以使用goto,在函数之间进行跳转就需要使用setjmp函数 #include <setjmp.h>int setjmp(jmp_buf envbuf);该函数将系统栈保存于envbuf中,以供以后调用longjmp()。当第一次调用setjmp(),它的返回值为0。之后调用
阅读全文
posted @ 2022-06-10 15:48 gǒが油メo
阅读(192)
评论(0)
推荐(0)
下一页
公告