MCPcopy Create free account
hub / github.com/Lakhankumawat/LearnCPP / pushStack

Function pushStack

S-Stack/stackADTUsingLL.cpp:28–42  ·  view source on GitHub ↗

----------------This function pushes the data into the node--------------------------*/

Source from the content-addressed store, hash-verified

26
27/*----------------This function pushes the data into the node--------------------------*/
28bool 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-----------------*/
45void* popStack(STACK* stack){

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected