Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Booking **bookingSelectPaid(Booking **booking)
- {
- Booking **ret = malloc(sizeof(Booking*));
- size_t i = 0;
- int numOfPaid = 0;
- while (booking[i] != NULL)
- {
- if (booking[i]->paid == 1)
- {
- ++numOfPaid;
- size_t newsize = sizeof(Booking*) * (numOfPaid + 1); ret = realloc(ret, newsize);
- ret[i] = booking[i];
- ret[i+1] = NULL;
- }
- ++i;
- }
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement