Gidhub BE Developer

Stack 초기화 하는 법

2017-10-17
goodGid

Key Point

  • Stack Clear 하는 법

Code

#include <iostream>
#include <stack>
using namespace std;

stack<int> s;

int main(){
    s.push(1);
    s.push(2);
    s.push(3);
    
    /*
     Stack Clear !
     */
    while( !s.empty() ) 
        s.pop();
    
    return 1;
}

Recommend

Index