// After line 6
staticconstint max = 50; // Or whatever max size you want
Note: std::vector is safer to use than a raw array.
note: You won't be able to do a cin to max here. If you want to prompt the user for some number of values to put on the stack, use a different variable.
Thank you for the fast reply. I am just using max for user to set the max amount of "space" in stack. And I do not know how to make user in line 54: to enter the value. And I am aware that cin >> max is not the right method but I have no idea how to make it for user to change. How do I connect different variable with global max variable. Thank you so much for help and fast replying.
As I suggested above, std::vector is safer to use. A std::vector has no explicit limit on the number of entries and keeps track of the number of entries automatically.