Write a Push function for a Stack in C
I have to write a function, using pointers and an array that acts like a stack, that "pushes" an integer value onto the stack.

An array is declared as:

    #define stackSize = 10
    int top = 0, MyStack[stackSize];

The function header needs to be:

    void push(int val, int *stacktop, int *stack) {...}

where "val" is the integer to be added to the stack. I'm not sure how to use the other two function parameters to write the push function. Could someone get me started?

EDIT: I've tried this so far, but it doesn't use all the parameters:

    void push(int val, int *stacktop, int *stack) {
	    int i = 0;
	    *(stack + i) = val;
	    i++;
    }
Write a Push function for a Stack in C
===

I have to write a function, using pointers and an array that acts like a stack, that "pushes" an integer value onto the stack.

An array is declared as:

    #define stackSize = 10
    int top = 0, MyStack[stackSize];

The function header needs to be:

    void push(int val, int *stacktop, int *stack) {...}

where "val" is the integer to be added to the stack. I'm not sure how to use the other two function parameters to write the push function. Could someone get me started?

EDIT: I've tried this so far, but it doesn't use all the parameters:

    void push(int val, int *stacktop, int *stack) {
	    int i = 0;
	    *(stack + i) = val;
	    i++;
    }