- 9
- 0
- 约1.06万字
- 约 10页
- 2018-03-07 发布于河南
- 举报
操作系统主存分配
固定算法
#include malloc.h
#include stdio.h
#include string.h
#define NULL 0
typedef struct table
{int address; /*存储分区起始地址*/
int length; /*存储分区长度*/
int flag; /*存储分区标志,0为空闲,1为被作业占据*/
char name[10]; /*存储分区占用标志作业名*/
struct table *next;
}node;
node *creat() /*定义函数,建立主存分配表*/
{ node *head;
node *p1,*p2;
int n=0;
printf(Input the table:\n address length flag(0..1)\n);
p1=p2=(node *)malloc(sizeof(node));
scanf(%d%d%d,p1-address,p1-length,p1-flag);
if(p1-flag==1)
{printf(\t input job_name);scanf(%s,p1-name);}
else strcpy(p1-name,n
原创力文档

文档评论(0)