填空题

若要访问指针变量p所指向的数据,应使用表达式______。

【参考答案】

*p
<上一题 目录 下一题>
热门 试题

填空题
请将下列栈类Stack补充完整。 class Stack private: int pList[100]; int 数组,用于存放栈的元素 int top; 栈顶元素(数组下标) public: Stack():top(0) void Push(const int &item); 新元素item压入栈 int Pop(void); 将栈顶元素弹出栈 ; void Stack::Push(const int &item) if(top==99) 如果找满,程序终止 exit(1); top++; 栈顶指针增1 ______; int Stack::Pop() if(top<0) 如果栈空,程序终止 exit(1); return pList[top--];
填空题
请将下列程序补充完整,使得输出结果为bbaa。 #include<iostream> using namespace std; class A public: ______cout<< aa ; ; class B:public A public: ~B()cout<< bb ; ; int main() B *p=new B; delete p; return 0;
相关试题
  • 已知类sample是一个抽象类,其成员函数disp...
  • 在下列的程序的横线处填上适当的语句,使该...