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

Function popStack

S-Stack/stackADTUsingLL.cpp:45–62  ·  view source on GitHub ↗

----------------This function pops the data from the stack-----------------*/

Source from the content-addressed store, hash-verified

43
44/*----------------This function pops the data from the stack-----------------*/
45void* popStack(STACK* stack){
46 void* dataOutPtr;
47 STACK_NODE* temp;
48
49 if(stack -> count == 0)
50 dataOutPtr = NULL;
51 else{
52 temp = stack -> top;
53 dataOutPtr = stack -> top -> dataPtr;
54
55 stack -> top = stack -> top -> link;
56
57 free(temp);
58
59 (stack -> count)--;
60 }
61 return dataOutPtr;
62}
63
64
65

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected