Returns the number of items in a list
| 122 | |
| 123 | // Returns the number of items in a list |
| 124 | int CountListItems(listnode **listp) { |
| 125 | listnode *node; |
| 126 | int count = 0; |
| 127 | |
| 128 | for (node = *listp; node != NULL; node = node->next) |
| 129 | count++; |
| 130 | |
| 131 | return count; |
| 132 | } |
| 133 | |
| 134 | // returns a pointer the given item index in a list |
| 135 | // Returns NULL if point not found |