嵌入式 Linux C
文章平均质量分 51
嵌入式 Linux C学习记录及相关代码
是你的阿玉呀~~
这个作者很懒,什么都没留下…
展开
-
嵌入式LinuxC--数据结构--双向链表中所有功能的实现
头文件及结构体定义 #include <stdio.h> #include <stdlib.h> typedef struct Node* node; 1.双向链表的结构体定义 struct Node { int value; struct Node *next; struct Node *prev; }; 2.插入新的双向结构体 nt init(node *head) { node newnode = (node)malloc原创 2021-02-09 18:27:21 · 100 阅读 · 0 评论 -
嵌入式LinuxC--数据结构--单向链表中所有功能的实现
头文件 #include <stdio.h> #include <stdlib.h> 1.定义链表结构体 struct Node { int value; struct Node* next; }; 2.定义新的链表节点 int init(struct Node **head) { struct Node *newnode = (struct Node *)malloc(sizeof(struct Node)); if (NULL == ne原创 2021-02-09 17:56:36 · 176 阅读 · 0 评论 -
嵌入式LinuxC--指针与数组
一、指针 1.指针是什么? 指针是一种变量,用来保存数据(即地址) 保存的数据固定长度(也就是地址的长度固定,由操作系统决定。 占用字节4/8个 2.指针运算 :取值运算符 *ptr :取指针ptr变量对应对应内存空间的地址所对应的内存空间的值 取ptr变量指向的内存的值 对应内存空间 VS指向的内存空间 对应内存空间:即储存变量ptr的的地方 指向的内存空间:变量ptr保存的是地址,这个地址指向的空间就是指向的内存空间 多级指针的作用 保存上一级指针变量的地址 指针数值运算 ptr++:指针向后走原创 2021-02-02 21:00:34 · 174 阅读 · 0 评论