我调用堆栈查看错误
head是我定义的一个PBC类的一个指针
PBC类的具体代码:
头文件
#pragma once
class PBC
{
public:
PBC(void);
~PBC(void);
PBC(string name,int time,int Runtime,int priority,char state,PBC* next);//构造函数
public:
string name;//进程名
int time;
int Runtime;//运行时间
int priority;//优先级
char state;//状态
PBC* next;//指向下一个进程
};
具体实现
#include "StdAfx.h"
#include "PBC.h"
PBC::PBC(void)
{
name="0",time=0,Runtime=0,priority=0,state=NULL,next=0;
}
PBC::~PBC(void)
{
}
PBC::PBC(string name,int time,int Runtime,int priority,char state,PBC* next)
{
this->name=name;
this->time=time;
this->Runtime=Runtime;
this->priority=priority;
this->state=state;
this->next=next;
}