请教一个关于继承的问题
#include <iostream>
#include <process.h>
using namespace std;
const int MAX =200;
class queue
{
protected:
int qdata[MAX];
int tail,head;
public:
queue(void)
{
tail = head = 0;
}
void pushta(int i)
{
tail++;
qdata[tail] = i;
cout << "tail=" << tail << endl;
}
int pophe(void)
{
head++;
cout << "head=" << head << endl;
return qdata[head];
}
};
class queue2:public queue
{
public:
void pushta(int i)
{
if(tail < MAX) //tail初始值是0对吗?因为继承了queue类
queue::pushta(i); //这里,pusht a(i)是用的queue类的成员函数,i是多少
//怎么调用的,看不懂
else
{
cout << "queue is full\n";
return;
}
}
int pophe(void)
{
if(head < tail)
return queue::pophe();
else
{
cout << "queue underflow\n";
exit(1);
}
}
};
int main(void)
{
queue2 q;
q.pushta(123);
q.pushta(456);
cout << "1:" << q.pophe() << endl;
cout << "2:" << q.pophe() << endl;
cout << "3:" << q.pophe() << endl;
system("pause");
return 0;
}
这个程序看不懂了,大家帮我讲解一下这个程序流程
pocess是什么函数,标准c++该怎么调用