Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
STL stack
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//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; }
clang++
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
Compilation time: 0.52 sec, absolute running time: 0.14 sec, cpu time: 0 sec, memory peak: 4 Mb, absolute service time: 0.67 sec
edit mode
|
history
|
discussion