资源简介

代码片段和文件信息
#include
#include
#include“.\include\queue.h“
#include“string.h“
int main()
{
consolePrint();
int initNum;
scanf(“%d“&initNum);
if(initNum==1) init();
else if(initNum==2) {init2();
DisplayQueue();}
else init();
char input[100];
int inNumeber;
while(1)
{
printf(“Please input the operating number you want to:\n“);
scanf(“%d“&inNumeber);
if(inNumeber==0) break;
else if(inNumeber==1)
{
printf(“please input the process name and priority following the method mentioned above:\n“);
scanf(“%s“input);
char *tokenPtr=strtok(input“:“);
char* res[10];
int arrayIndex=0;
while(tokenPtr!=NULL)
{
res[arrayIndex] = tokenPtr;
tokenPtr=strtok(NULL“:“);
arrayIndex ++;
}
char* name = (char*)malloc(sizeof(char)*16);
int priority=3;
if(arrayIndex==1) strcpy(nameres[0]);
else if(arrayIndex=2)
{
strcpy(nameres[0]);
priority =atoi(res[1]);
}
else {printf(“Wrong Instruction format!\n“);continue;}
struct process newProcess = {autoPID++nameREADYpriority10};
struct QueueNode* newNode = (struct QueueNode*)malloc(sizeof(struct QueueNode));
newNode->task = newProcess;
newNode->next = NULL;
createProcess(newNode);
DisplayQueue();
}
else if(inNumeber==2)
{
//printf(“this function don‘t need you to input\n“);
blockProcess();
DisplayQueue();
}
else if(inNumeber==3)
{
printf(“please input the process name and priority following the method mentioned above:\n“);
scanf(“%s“input);
char *tokenPtr=strtok(input“:“);
char* res[10];
int arrayIndex=0;
while(tokenPtr!=NULL)
{
res[arrayIndex] = tokenPtr;
tokenPtr=strtok(NULL“:“);
arrayIndex ++;
}
int PID;
if(arrayIndex==1||arrayIndex==2||arrayIndex==3)
PID = atoi(res[0]);
else {printf(“Wrong Instruction format!\n“);continue;}
//DisplayQueue();
struct process newProcess = {PID};
struct QueueNode* newNode = (struct QueueNode*)malloc(sizeof(struct QueueNode));
newNode->task = newProcess;
newNode->next = NULL;
//DisplayQueue();/**< for debug */
wakupProcess(newNode);
DisplayQueue();
}
else if(inNumeber==4)
{
printf(“please input the process name and priority following the method mentioned above:\n“);
scanf
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-05-24 19:15 process\
目录 0 2018-05-17 21:28 process\bin\
目录 0 2018-05-18 21:43 process\bin\Debug\
文件 82866 2018-05-18 21:43 process\bin\Debug\process.exe
目录 0 2018-05-18 13:04 process\include\
文件 93 2018-05-18 10:11 process\include\global.h
文件 340 2018-05-18 09:58 process\include\process.h
文件 1228 2018-05-18 13:04 process\include\queue.h
文件 3893 2018-05-18 15:10 process\main.c
目录 0 2018-05-17 21:28 process\obj\
目录 0 2018-05-18 21:43 process\obj\Debug\
文件 6782 2018-05-18 21:43 process\obj\Debug\main.o
目录 0 2018-05-18 14:35 process\obj\Debug\src\
文件 509 2018-05-18 10:11 process\obj\Debug\src\global.o
文件 11285 2018-05-18 14:35 process\obj\Debug\src\queue.o
文件 1261 2018-05-18 15:02 process\process.cbp
文件 598 2018-05-24 19:01 process\process.depend
文件 925 2018-05-24 19:15 process\process.layout
目录 0 2018-05-18 14:35 process\src\
文件 51 2018-05-18 10:11 process\src\global.c
文件 8722 2018-05-18 14:35 process\src\queue.c
- 上一篇:Tbmenu18.ocx
- 下一篇:axure 饼状图、折线图、柱状图元件库
相关资源
- 升腾Win终端系统升级方法新版.doc
- Uninstall_Cortana_WINCLIENT.CN.rar
- STM32基于rt_thread操作系统的SDHC卡文件
- 操作系统 LRU算法 实验报告 及 程序代
- [免费]车载CE6.0操作系统
- 分页系统模拟实验 操作系统 课程设
- 模拟段页式虚拟存储管理中地址转换
- 操作系统实验——虚存管理实验
- 广工操作系统实验
- 广东工业大学操作系统实验四文件系
- Bochs入门教程[操作系统第一步]
- 操作系统课程设计完整版
- 磁盘调度算法的模拟实现及对比
- 模拟一个文件管理系统
- 二级文件系统(操作系统)
- uCOS编译环境建立 BC45 TASM
- Linux 操作系统实验(全)
- 操作系统实验综合设计【附代码】
- 操作系统共享内存实验
- 操作系统循环首次适应算法
- 操作系统课程设计实现可变分区存储
- 基于GTK的Linux环境下的简易任务管理器
- 操作系统课程设计 二级文件管理系统
- 加快Windows XP操作系统开机速度
- 操作系统教程课后答案华中科技大学
- 51单片机中使用ucos ii的优缺点转
- 51单片机中使用ucos ii的优缺点
- 嵌入式实时操作系统ucos-II 第二版 源
- 计算机操作系统课后_汤小丹_第四版
- 计算机操作系统(第四版)汤小丹课
评论
共有 条评论