Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
STL stack
//Title of this code //clang 3.6.0 #include <iostream> #include <stack> using namespace std; int main(void) { stack <int> st1,st2; int j; cout<<"Pushing data into stack..."<<endl; st1.push(21); j=st1.top(); cout<<j; st1.push(9); j=st1.top(); cout<<j; st1.push(12); j=st1.top(); cout<<j; st1.push(31); j=st1.top(); cout<<j<<endl; stack<int>::size_type i; i=st1.size(); cout<<"The stacklength is"<<i<<endl; i=st1.top(); cout<<"The element at the top of the stack is"<<i<<endl; st1.pop(); i=st1.size(); cout<<"After a pop,the stack length is"<<i<<endl; i=st1.top(); cout<<"After a pop,the element at the top of the stack is"<<i<<endl; return 0; }
run
|
edit
|
history
|
help
0
function returning a function demo
set/map equal_range bug in libc++
Rounding float to nearest 1000 (fixed)
BinaryGap, C++ - Find longest sequence of zeros in binary representation of an integer.
non-deduced context
Math1
my override
Pointer array
PrintAddress
HTML Timetable generator.cpp