Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ReviewNode *insertMovieReview(char *title, char *studio, int year, double BO_total, int score,
- ReviewNode *head)
- {
- /***************************************************************************/
- /********** TODO: Complete this function **********************************/
- /***************************************************************************/
- ReviewNode *p = NULL;
- p = head;
- while (p != NULL) {
- if (strcmp(title, p -> review.movie_title) == 0 && \
- strcmp(studio, p -> review.movie_studio) == 0 && \
- year == p -> review.year && \
- BO_total == p -> review.BO_total && \
- score == p -> review.score) {
- return head;
- }
- p = p -> next;
- }
- ReviewNode *new_node = newMovieReviewNode(title, studio, year, BO_total, score);
- new_node -> next = head;
- return new_node;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement