Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. ReviewNode *insertMovieReview(char *title, char *studio, int year, double BO_total, int score,
  2. ReviewNode *head)
  3. {
  4. /***************************************************************************/
  5. /********** TODO: Complete this function **********************************/
  6. /***************************************************************************/
  7. ReviewNode *p = NULL;
  8. p = head;
  9. while (p != NULL) {
  10. if (strcmp(title, p -> review.movie_title) == 0 && \
  11. strcmp(studio, p -> review.movie_studio) == 0 && \
  12. year == p -> review.year && \
  13. BO_total == p -> review.BO_total && \
  14. score == p -> review.score) {
  15. return head;
  16. }
  17. p = p -> next;
  18. }
  19. ReviewNode *new_node = newMovieReviewNode(title, studio, year, BO_total, score);
  20. new_node -> next = head;
  21. return new_node;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement