?? memory.cpp
字號:
// Memory.cpp : 定義控制臺應用程序的入口點。
//
#include "stdafx.h"
#include "MyMemory.h"
int main(int argc, _TCHAR* argv[])
{
CMyMemory memory;
char cmd[256];
int pos;
int size;
while(1)
{
printf("#>");
cin>>cmd;
if(!strcmp(cmd,"showdetail"))
{
memory.ShowDetail();
}
else if(!strcmp(cmd,"allocation"))
{
cout<<"size:";
cin>>size;
memory.Allocation(size);
memory.ShowDetail();
}
else if(!strcmp(cmd,"release"))
{
cout<<"Block No:";
cin>>pos;
if(pos>=0 && pos<memory.EmptyList.ListSize())
{
memory.Release(pos);
memory.Merge();
}
}
/*else if(!strcmp(cmd,"merge"))
{
memory.Merge();
memory.ShowDetail();
}*/
else if(!strcmp(cmd,"exit"))
{
return 0;
}
else//(!strcmp(cmd,"help"))
{
system("cls");
cout<<"command error!"<<endl;
cout<<"[HELP]"<<endl;
cout<<"allocation\tallocation a block"<<endl;
cout<<"release\t\trelease a block"<<endl;
cout<<"merge\t\tmerge blank block"<<endl;
cout<<"exit\t\texit program"<<endl;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -