Skip to content

Overflow Underflow (possible) bugs in some compiler versions #2

Description

@Haroon-64

void stack::push(int item) { if (top == 4) { cout << "stack is full"<<endl; //didnt work in old compiler } else { top++; x[top] = item; } }

and

void stack::pop() { if (top == -1) { cout << "stack is empty"; //looped in old compiler } else { cout << "deleted item is" << x[top]; top--; } }

not looking for fix but explaination

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginvalidThis doesn't seem rightquestionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions