Need a project done?

C++ Programming Developer

Search This Blog

Showing posts with label Stack. Show all posts
Showing posts with label Stack. Show all posts

Built in Stack in C++ - STL

#include "stdafx.h"
#include <iostream>
#include <stack>

using namespace std;

int main(int argc, _TCHAR* argv[])
{
stack<int> st;
st.push(1);
cout << "Pushed: " << st.top() << endl;
st.push(2);
cout << "Pushed: " << st.top() << endl;
st.push(3);
cout << "Pushed: " << st.top() << endl << endl;
while (!st.empty())
{
cout << "Emptying..." << endl;
st.pop();
}
//cout << "Stack top now: " << st.top() << endl;
}

Stack using linked list in C++


Stack using linked list in C++ program is given below:

//Stack using linked list in C++ using templates
#include <iostream>
using namespace std;

Stack using Link List in C++

Program to create a stack using link list in C++.

//Stack using Link List in C++
#include <iostream>
using namespace std;

Stack in C++ | Program to create a stack in C++

Stack in C++ program is given below:

//Stacks in C++
#include <iostream>
using namespace std;

"Don't let anyone ever make you feel like you don't deserve what you want."