上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 91 下一页
摘要: 进阶版多进程程序实例 主要是使用子进程去执行调用另外一个可执行程序,具体实现是调用 exec 函数簇实现一个进程对执行另外一个可执行程序的功能。 exec 函数簇定义 #include <unistd.h> extern char **environ; int execl(const char *p 阅读全文
posted @ 2023-01-17 17:08 王清河 阅读(264) 评论(0) 推荐(0)
摘要: 简单版多进程程序实例 代码 // fork 生成子进程 // 父进程调用 fork 返回的是子进程的进程ID,子进程调用该函数返回的是 0 #include<iostream> #include<unistd.h> #include<cstdio> int main() { pid_t pid = 阅读全文
posted @ 2023-01-16 14:26 王清河 阅读(1763) 评论(0) 推荐(1)
摘要: 介绍 在安卓中,如果想要查看一个安卓进程的信息,包括该进程拥有的用户权限和用户组权限,进程依赖的动态库等信息的话,可以在 proc 文件夹中查看,具体的查看方法如下: 查看进城的id号 ps -ef | grep [keyword] 通过keyword 查看到该进程的进程号 在根目录下,找到 pro 阅读全文
posted @ 2023-01-11 15:12 王清河 阅读(786) 评论(0) 推荐(0)
摘要: 动态库的生成 代码 // animal.hpp #ifndef _ANIMAL_HPP #define _ANIMAL_HPP typedef unsigned int uint; class animal { private: uint m_number; uint m_size; public: 阅读全文
posted @ 2023-01-06 17:09 王清河 阅读(464) 评论(0) 推荐(0)
摘要: 静态库的生成 代码 add.h #ifndef _ADD_H_ #define _ADD_H_ int add(int a,int b); #endif add.cpp #include<iostream> #include"add.h" int add(int a,int b){ return a 阅读全文
posted @ 2022-11-30 11:06 王清河 阅读(987) 评论(0) 推荐(1)
摘要: 项目背景 1. 上层需求是操作芯片(读写寄存器) 2. 操作方式使用IIC和SPI,直接读写文件节点(linux以及类linux环境下) 已知信息 1. BSP 提供了SPI和IIC的驱动节点(等同文件,打开,读写即可) 2. BSP 给定Slave address: 0x1c(7字节) 读写代码 阅读全文
posted @ 2022-10-28 16:09 王清河 阅读(326) 评论(0) 推荐(0)
摘要: 概念介绍 try...catch 异常捕获,当程序出一个错误时,可以进入错误处理函数,而不同退出,其中 try statement 中是正常的代码块 catch 是当出现一个错误时,会进入该模块进行错误处理。如遇到除 0 错误,段溢出错误 throw 是抛出异常,这个异常不一定错误,只要是认为是有误 阅读全文
posted @ 2022-09-06 16:36 王清河 阅读(317) 评论(0) 推荐(0)
摘要: 参考 std::string #include<iostream> #include<string> using namespace std; int main() { string str; string base = "The quick brown fox jumps over a lazy 阅读全文
posted @ 2022-08-16 10:54 王清河 阅读(513) 评论(0) 推荐(0)
摘要: https://www.cnblogs.com/poissonnotes/p/8444886.html 命名 目录命名 名词短语 -- 小蛇型:全小写字母 + 下划线 名字空间 名次短语 -- 小蛇型:全小写字母 + 下划线 文件命名 名词短语 -- 大驼峰:每个首字母大写 + 继承类名 类和类型 阅读全文
posted @ 2022-08-11 13:03 王清河 阅读(285) 评论(0) 推荐(0)
摘要: C++中,如果进行二进制转换 #include<iostream> #include<bitset> using namespace std; #define unsigned int uint32_t void transferRadix(int n){ cout << "hex: " << st 阅读全文
posted @ 2022-08-05 10:52 王清河 阅读(94) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 91 下一页