宣告一個名為 bottle 的 C++類別(class)如下所示,然後接下來宣告bb 為對應到該類別的一個物件,並依序執行以下指令:bb.push('x')、bb.push('y')、bb.push('z')、bb.pop(),則最後所回傳的值為下列何者? class bottle { private: int top; char elements[50]; public: bottle() { top = -1; }; char pop() { top = top - 1; return elements[top+1]; } void push(char c) { top = top + 1; elements[top] = c; } };
Ax
By
Cz正確答案
DNULL
答案與詳解
