📄 makefile.txt
字号:
//makefile.cpp
///////////////////////
//文件生成程序
#include <fstream.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
struct operation
{
int time;//起始时间
int block;//内存页数
int oper;//操作
int protection;//权限
};
int main()
{
FILE *file;
file=fopen("opfile","wb");//"opfile"为二进制用以确定内存操作
operation op;
for(int j=0;j<6;j++)
for(int i=0;i<5;i++)
//0-page_readonly;
//1-page_readwrite;
//2-page_exectue;
//3-page_exectue_read;
//4-page_exectue_readwrite;
{
op.time=rand()%1000;//随机生成等待时间
op.block=rand()%5+1;//随机生成块大小
op.oper=j;
op.protection=i;
fwrite(&op,sizeof(operation),1,file);//将生成的结构写入文件
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -