----------------This function pushes the data into the node--------------------------*/
| 26 | |
| 27 | /*----------------This function pushes the data into the node--------------------------*/ |
| 28 | bool pushStack(STACK* stack, void* dataIn){ |
| 29 | STACK_NODE* newPtr; |
| 30 | |
| 31 | newPtr = (STACK_NODE*)malloc(sizeof(STACK_NODE)); |
| 32 | if(!newPtr) |
| 33 | return false; |
| 34 | |
| 35 | newPtr -> link = stack -> top; |
| 36 | newPtr -> dataPtr = dataIn; |
| 37 | |
| 38 | stack -> top = newPtr; |
| 39 | (stack -> count)++; |
| 40 | |
| 41 | return true; |
| 42 | } |
| 43 | |
| 44 | /*----------------This function pops the data from the stack-----------------*/ |
| 45 | void* popStack(STACK* stack){ |