wimanshaherath / Data-structures

implement data structures in c++
MIT License
2 stars 17 forks source link

Array index out of bounds for pop operation on empty stack #5

Closed prantaneel closed 2 years ago

prantaneel commented 2 years ago

Issue Description:

Index of array in stack implementation (C++) goes out of bounds when pop function is called on empty stack.

Suggested Fix:

Exception handling to avoid out of bounds array accesses.

wimanshaherath commented 2 years ago

Thanks for the suggestion @soulado I'll fix it.