- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack.c
More file actions
Latest commit
22 lines (18 loc) · 342 Bytes
/
Copy pathstack.c
File metadata and controls
22 lines (18 loc) · 342 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include<iostream>
#include"stack.h"
usingnamespacestd;
voidinitStack(Stack*s) {
s->top=-1;
}
voidpush(Stack*s, void*data) {
s->top++;
s->myStack[s->top] =data; // Copy data
}
void*pop(Stack*s) {
void*retVal=s->myStack[s->top];
s->top--;
return(retVal);
}
boolisEmpty(Stack*s) {
return(s->top==-1);
}