Question: prog1 2 and typedefs typedef struct stack( Create a header file (prog1_2.h) which will contain the following function prototypes int* data; int size; int capacity:

 prog1 2 and typedefs typedef struct stack( Create a header file

prog1 2 and typedefs typedef struct stack( Create a header file (prog1_2.h) which will contain the following function prototypes int* data; int size; int capacity: STACK STACK* MakeStack (int initialCapacity); void Push (STACK *stackPtr,int data) int Pop (STACK stackPtr) void Grow (STACK *stackPtr) Create a source file (prog1_2.c) that will implement the MakeStack, Push, Pop and Grow functionality. The STACK that is produced by the MakeStack function should be able to hold initialCapacity integers. The Grow function should double a stacks capacity without changing any of the values held by the STACK. The Push and Pop functions should work as expected for a stack. The Push function should Grow the stack if there isn't enough capacity to hold the pushed data. The Pop function should return -1 if there is no data in the STACK. Yes, this is probably incorrect behavior

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!