A template-based stack implementation in C++ with a user-friendly, menu-driven interface. This project reinforces understanding of stack data structures, type generalization using templates, and basic input validation for secure operations.
- Developed a generic
Stack<T>class using C++ templates - Interactive CLI to perform stack operations such as:
push() pop() top() isEmpty() size() - Fully type-generic: works with user-defined types (int, float, string, etc.)
- Basic input validation to avoid runtime misuse and simulate boundary cases
- Clear structure and modular code for ease of maintenance
- Defensive programming practices: checks for overflow/underflow
- Data Structures: Stack (LIFO)
- C++ Templates for generic programming
- Menu-based console UI using standard I/O
- Safety checks to prevent invalid operations (e.g., popping from an empty stack)
- C++ (Templates, OOP)
- Vi Editor
- CLI tools and standard library I/O
********** Main Menu ***********
-----------------------------------
1. Push Element
2. Pop Element
3. View Top
4. Display Stack
5. Check Empty
6. Stack Size
7. Exit
Select option:
-----------------------------------Stack<int> intStack;
intStack.push(10);
intStack.push(20);
std::cout << intStack.top(); // Output: 20
intStack.pop();
std::cout << intStack.size(); // Output: 1.
├── Stack.hpp # Template class declaration
├── main.cpp # Menu-driven interface and test driver
└── Makefile # Build system
This project demonstrates proficiency in C++ templates, OOP, and command-line application development—critical skills for system-level and backend development roles.








