南京邮电大学 linux实验报告,南京邮电大学实验报告版 2.doc

南京邮电大学实验报告版 2

实 验 报 告

(20 / 2015 学年 第 学期)

课程名称实验名称实验时间年月日指导单位指导教师

学生姓名班级学号学院(系)专 业

实 验 报 告

实验名称指导教师实验类型实验学时实验时间实验目的和要求

通过请求页式存储管理中页面置换算法模拟设计,了解虚拟存储技术的技术特点,掌握请求页式存储管理的页面置换算法设计实现下面算法,并二、实验环境(实验设备)

Vc++6.0实验原理及内容

实验四

Login用户登录

bool chklogin(char *users, char *pwd)

{

int i;

for(i=0; i<8; i++)

{

if( (strcmp(users,usrarray[i].name)==0) && (strcmp(pwd,usrarray[i].pwd)==0))

return true;

}

return false;

}

Create创建文件

int create()

{

temp=initfile(" ",0);

cin>>temp->filename;

cin>>temp->content;

if(recent->child==NULL)

{

temp->parent=recent;

temp->child=NULL;

recent->child=temp;

temp->prev=temp->next=NULL;

cout<

}

else

{

ttemp=recent->child;

while(ttemp->next)

{

ttemp=ttemp->next;

if(strcmp(ttemp->filename,temp->filename)==0&&ttemp->isdir==0)

{

printf("对不起,文件已存在!");

return 1;

}

}

ttemp->next=temp;

temp->parent=NULL;

temp->child=NULL;

temp->prev=ttemp;

temp->next=NULL;

cout<

}

return 1;

}

int dir()

{

int i=0,j=0;

temp=new fnode;

temp=recent;

if(temp!=root)

{cout< "<

if(temp->child==NULL)

{

cout<

return 1;

}

temp=temp->child;

while(temp)

{

if(temp->isdir)

{cout<\ "<filename<

else

{cout< "<filename<

temp=temp->next;

}

cout<

}

Read读取文件

int read()

{

char filename[FILENAME_LENGTH];

cin>>filename;

if(recent->child==NULL)

{

cout<

return 1;

}

if(strcmp(recent->child->filename,filename)==0)

{

cout<child->content<

return 1;

}

else

{

temp=recent->child;

while(temp->next)

{

if(strcmp(temp->next->filename,filename)==0)

{cout<next->content<

return 1;}

}

cout<

}

}

int write()

{

char filename[FILENAME_LENGTH];

cin>>filename;

if(recent->child==NULL)

{

cout<

return 1;

}

if(strcmp(recent->child->filename,filename)==0)

{

recent->child->isopen=1;//设置文件标记为打开

cin>>recent->child->content;

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值