七.银行家算法程序代码 #include #include #include using namespace std; typedef struct Max1 // 资源的最大需求量 { int m_a; int m_b; int m_c; }Max; typedef struct Allocation1 //已分配的资源数 { int a_a; int a_b ; int a_c; }Allocation; typedef struct Need1 //还需要的资源数 { int n_a;
实现程序的主要函数有四个: GetOsVersion() //取得操作系统版本 GetMemInfo() //取得内存信息 GetDriverInfo() //取得驱动器信息 GetCpuInfo() //取得CPU信息,这里只是读取了注册表的ProcessorNameString具体代码见程序! (procedures to achieve the four main functions : GetOsVersion ()// OS version made GetMemInfo ()//