已采納回答 / 精慕門6399046
缺省值在Customer類的構造函數的聲明中寫就可以了。譬如:Customer(string name = "",int age = 0);在.cpp文件中實現Customer構造函數如下:Customer:Customer(string name,int age){}
2019-03-09
最新回答 / AngerLee
本節插入元素是int類型,只需要關注int 類型的值,所以使用不帶&的類型將int的值傳入。出列是為了獲取隊列中的值,我們調用函數獲得調用函數內部的計算結果有三種方式:返回值,指針,引用,本節用的是引用,即&,我們也可以使用指針或者返回值去獲取函數內部的結算結果。
2019-03-07
感覺遍歷函數這樣寫比較好理解,有錯誤望指出
void MyQueue::QueueTraverse()
{
for(int i = 0 ; i < m_iQueueLen; i++)
{
cout << m_pQueue[(m_iHead+i)%m_iQueueCapacity]<<endl;
}
}
void MyQueue::QueueTraverse()
{
for(int i = 0 ; i < m_iQueueLen; i++)
{
cout << m_pQueue[(m_iHead+i)%m_iQueueCapacity]<<endl;
}
}
2019-01-08