需要编码帮助 [英] need coding help
本文介绍了需要编码帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想要用C ++语言制作的基于优先级的操作系统代码
利用调度算法
i want the code of priority based operating system made in C++ language
make the use of scheduling algorithms
推荐答案
#include "libraryLoader.h"
#include < iostream>
using namespace std;
typedef bool(*PFNOS)(bool);
class priorityBasedOperatingSystem
{
public:
priorityBasedOperatingSystem(bool bUseSchedulingAlgorithms)
:m_bUseSchedulingAlgorithms(bUseSchedulingAlgorithms)
{
m_handleToTheLibraryModulesThatContainTheRealCode = libraryLoader::load("realCodeForMyDreamOS");
}
// returns false if couldn''t run
bool run()
{
if(0 == m_handleToTheLibraryModulesThatContainTheRealCode)
return false;
PFNOS pfn = (PFNOS)m_handleToTheLibraryModulesThatContainTheRealCode;
return pfn(m_bUseSchedulingAlgorithms);
}
private:
bool m_bUseSchedulingAlgorithms;
long m_handleToTheLibraryModulesThatContainTheRealCode;
};
void main()
{
priorityBasedOperatingSystem pbos;
if(!pbos.run())
cout << "StupidHelpersOnCodeProject, we got a problem" << endl;
else
cout << "T-A-D-A...I guess you already heard that, doh" << endl;
}
我添加此编辑内容是为了提及之前我编辑了原始帖子中的一些错误和错别字.总共必须进行3次修改.
EDIT : I am adding this edit to mention that earlier I edited a few bugs and typos from original post. That must make that a total of 3 edits.
搜索 ^ ]在Google上.这不是您要寻找的论坛.
Search for rentacoder[^] on google. This is not the forum you are looking for.
在这里无法正常工作. :doh:
这是询问者的期望:
1. 先尝试您要做什么!
2.制定看起来像问题/无法解决的问题.
尝试一下,告诉您是否遇到问题.
成员将很乐意为您提供帮助.
如果您仍然需要代码,那么我建议您使用另一个论坛: CP职位 [
It does not work like this here. :doh:
Here is what is expected by enquirers:
1. TRY first what you want to do!
2. Formulate what was done by you that looks like an issue/not working.
Try them and tell if you face issues.
Members will be more than happy to help like this.
If you still want code then I would suggest you another forum: CP Jobs[^]
这篇关于需要编码帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文