Question: C-programming. Can anyone show me how to create a makefile, so the c-file stack2.c can be tested in MainStack.c? stack2.c: MainStack.c: stack.h: 1 I stack2.

C-programming.

Can anyone show me how to create a makefile, so the c-file stack2.c can be tested in MainStack.c?

stack2.c:

C-programming. Can anyone show me how to create a makefile, so the

c-file stack2.c can be tested in MainStack.c? stack2.c: MainStack.c: stack.h: 1 I

MainStack.c:

stack2. 2 #include 3 #include 4 #include "stack,h" newstack(): function to create

stack.h:

a new stack malloc): memory allocation The function allocates the requested memory

1 I stack2. 2 #include 3 #include 4 #include "stack,h" newstack(): function to create a new stack malloc): memory allocation The function allocates the requested memory and returns a pointer to it. 9 10 11 stack_t2x newStack(void) ( 12 13 14 stack_p -array- (int*)malloc(sizeof (int)); 15 16 17 18 19 1% 0 pop(): function to remove an integer from the stack 21 22 int 23 stack_t2* stack_p-(stack_t2 *)malloc(sizeof(stack t2)); stack_p ->capacity- 1; stack-p-> size = 0; return stack_p; pop(stack_t2* stack_p) int result; while(stack_p->array--0) 25 26 stack_p->array++ 28 29 30 31 32 result *stack_p->array; *stack_p-sarray stack_p->size- return result; 4 push(): function to insert an integer in the array. For an array with no room left for another integer, the function allocates a new array with the double size of the previous 36 37 38 realloc): function to reallocate memory size

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!