Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ... */
- // This function adds an item to a list
- void addToList(struct list *myList, int item) {
- // If the list is full then resize the memory to fit 10 more items
- if (myList->numItems == myList->size) {
- myList->size += 10;
- myList->data = realloc( myList->data, myList->size * sizeof(int) );
- }
- /* ... */
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement