Skip to content

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

@Haroon-64

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

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