- 博客(13)
- 资源 (1)
- 收藏
- 关注
原创 stat函数实现ls -l 命令
#include <stdio.h>#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <stdlib.h>#include <string.h>#include <ti...
2019-10-07 21:48:36 510
原创 阻塞与非阻塞
阻塞的概念read函数在读设备或者读管道,或者读网络的时候,设置非阻塞#include <stdio.h> 2 #include <unistd.h> 3 #include <stdlib.h> 4 #include <fcntl.h> 5 #include <string.h> 6 #inc...
2019-10-06 15:11:18 184
原创 系统函数
实现一个cat功能#include <stdio.h> 2 #include <unistd.h> 3 #include <sys/stat.h> 4 #include <sys/types.h> 5 #include <fcntl.h> 6 7 8 int main(int argc, char *a...
2019-10-06 14:45:20 244
原创 open
cpu为什么要使用虚拟地址空间与物理地址空间映射?解决了什么问题1.方便编译器和操作系统安排程序的地址分布程序可以使用一系列相邻的虚拟地址来访问物理内存中不相邻的大内存缓冲区2.方便进程之间隔离不同进程使用的虚拟地址彼此隔离.一个进程中的代码无法更改正在由另一进程使用的物理内存3.方便OS使用你那渴念的内存程序可以使用一系列虚拟地址来访问大于可用物理内存的内存缓冲区.当物理内存的供应...
2019-10-06 13:57:35 264
原创 gdb调试
使用gdb:编译的时候加 -g使用案例:head.h #pragma once 2 3 int sum(int, int); 4 int mul(int, int); func.c #include <stdio.h> 2 #include "head.h" 3 4 int sum(int a, int b) 5 { 6 pr...
2019-10-05 13:53:25 229 1
原创 贪吃蛇案例_c++
wall.h#pragma once#ifndef _WALL_HEAD#define _WALL_HEAD#include <iostream>using namespace std;class Wall{public: enum { ROW = 26 , COL = 26 }; // 初始化墙壁 void initWall(); // ...
2019-10-01 22:32:02 271
原创 栈的顺序存储
SeqStack.h#pragma once#include <stdlib.h>#include <stdio.h>#include <string.h>#ifdef __cplusplusextern "C" {#endif#define MAX 1024 // 顺序栈数据结构 struct SStack { void *dat...
2019-10-01 09:50:12 299
原创 单向链表_版本二
#define _CRT_SECURE_NO_WARNINGS#include "stdio.h"#include "stdlib.h"// 链表节点struct LinkNode{ struct LinkNode *next;};// 链表struct LList{ struct LinkNode header; //头节点 int size;};typedef ...
2019-10-01 09:48:09 106
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人