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

Function display

S-Stack/stackADTUsingLL.cpp:85–99  ·  view source on GitHub ↗

----------------This function prints all the element sof the Stack----------*/

Source from the content-addressed store, hash-verified

83
84/*----------------This function prints all the element sof the Stack----------*/
85void display(STACK* stack){
86 int* a = NULL;
87 if(!stack)
88 cout << "Stack Underflow" << endl;
89 else
90 cout << "The stack elements are : " << endl;
91 STACK_NODE* temp = stack -> top;
92 while(temp -> link != NULL){
93 a = (int*)(temp -> dataPtr);
94 cout << *a << " ---> ";
95 temp = temp -> link;
96 }
97 a = (int*)(temp -> dataPtr);
98 cout << *a << endl;
99}
100
101int main(){
102 int* dataPtr;

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected