10.3 指针和对象实现
Last updated
Last updated
int Allocate_Object()
{
if(free == NULL)
{
cout<<"error:out of space"<<endl;
exit(0);
}
else
{
int x = free;
free = next[x];
return x;
}
}
void Free_Object(int x)
{
next[x] = free;
free = x;
}