Short answer : Allow insertion /deletion only at end of array.
Long Answer : Consider an array of ,initially, 50 elements ,count intially -1.
Push operation : When inserting keep a count of elements present,increment count ,overwrite element present at index count .
Pop operation : If we have a valid count , return element at index count. count--.
Display stack: if count is valid,starting at index count -1 till count =0 ,print all elemenets
Food for thought:
by chance if count >50 ,create new stack & copy paste data from original stack.(but now we need to release original memory ,allocate new memory (but how much 1 element worth mem.2 elements woth memeory 50 ,perhaps ??)