----------------This function creates new stack--------------------------*/
| 14 | |
| 15 | /*----------------This function creates new stack--------------------------*/ |
| 16 | STACK* createStack(){ |
| 17 | STACK* stack; |
| 18 | |
| 19 | stack = (STACK*)malloc(sizeof(STACK)); |
| 20 | if(stack){ |
| 21 | stack -> count = 0; |
| 22 | stack -> top = NULL; |
| 23 | } |
| 24 | return stack; |
| 25 | } |
| 26 | |
| 27 | /*----------------This function pushes the data into the node--------------------------*/ |
| 28 | bool pushStack(STACK* stack, void* dataIn){ |