| 68 | } |
| 69 | |
| 70 | void pushChar(CharStackList *list, char data) { // Insert At First |
| 71 | CharStackNode* newNode = malloc(sizeof(StackNode)); |
| 72 | newNode->next = NULL; |
| 73 | newNode->data = data; |
| 74 | |
| 75 | if(newNode == NULL) { |
| 76 | return; |
| 77 | } |
| 78 | |
| 79 | if(*list == NULL) { |
| 80 | *list = newNode; |
| 81 | } else { |
| 82 | CharStackNode *firstNode = *list; |
| 83 | *list = newNode; |
| 84 | (*list)->next = firstNode; |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | char peekChar(CharStackList list) { |
| 89 | if(list == NULL) |