
c
文章平均质量分 65
lwj~
这个作者很懒,什么都没留下…
展开
-
【读书笔记】linux/unix系统编程
第三张 系统编程概念 与用户空间函数调用相比,最简单的系统调用会产生比较大的打开,因为为了执行系统调用,系统需要临时切换到核心态,发生中断,此外,内核还需要验证系统调用的参数,用户内存和内核内存之间的数据需要传递 // 如果代码里有pidof()需要,可以换一种方式实现 while true: do local pid_s = `pidof super` fi sleep 5 done // 改进的程序 local pid_s = `pidof super` while true: do if [原创 2022-04-29 14:15:23 · 727 阅读 · 0 评论 -
【c 结构体数组用法】
#include <iostream> #include <cstdio> #include <cstdlib> using namespace std; typedef struct { int a; short b[2]; } Test2; typedef struct Test1{ int a; char b[3]; Test2 c; struct Test1 *d; } Test1; int main() { Test1 x = {1原创 2022-04-27 19:24:11 · 222 阅读 · 0 评论 -
【读书笔记】c和指针
第三章 1.作用域 1.代码作用域 , {} 2.文件作用域,头文件 3.原型作用域,函数传参 4.函数作用域,goto 2.链接属性 external,外部链接,外部源文件也可以访问。 staic修饰完,external变为internal internal,内部链接,本源文件内有效 none 3.存储类型 1.普通内存 2.运行时堆栈 3.硬件寄存器 1.代码外声明的变量 -> 静态存储。生命周期:程序一直运行就一直存在,而不是每次代码块开始时创建,代码执行完销毁 2.static关键原创 2022-02-27 15:56:47 · 906 阅读 · 0 评论