Array PopFront Method C++

后端 未结 5 2036
说谎
说谎 2021-01-29 15:48

Trying not to lose it here. As you can see below I have assigned intFrontPtr to point to the first cell in the array. And intBackPtr to point to the last cell in the array...:

5条回答
  •  春和景丽
    2021-01-29 16:01

    I'm assuming you're trying to assign the popped value to nPopFront?

    bool stack::popFront(int& nPopFront) 
    {    
        //items[4] = {4,3,2,1} 
        if ( intFrontPtr < intBackPtr ) 
        {    
                nPopFront = *intFrontPtr; 
                ++intFrontPtr; 
        } 
        return true; 
    } 
    

提交回复
热议问题