首页 > 其他 > 详细

stack(STL)

时间:2016-10-12 22:20:37      阅读:119      评论:0      收藏:0      [点我收藏+]
//Stack STL
//在STL中,栈是以别的容器作为底部结构,再将
//接口改变,使之符合栈的特性
//一共5个常用操作函数

//构造析构
stack<Elem>c;     //build a empty stack
stack<Elem>c1(c2);   //copy a stack

//5 functions
c.top();      //return the element  at the top of the stack
c.push(elem);     //push element at the top
c.pop();     //pop element at the top

c.empty();
c.size();    //return the size of the stack

//Stack is just a encapsulation of other container.
//It just supply its own interfaces.
//Elements are pushed/popped from the "back" of the specific container, which is //known as the top of the stack.

  

stack(STL)

原文:http://www.cnblogs.com/KennyRom/p/5954389.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!