Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

can some one help me figure out what\'s wrong with my operator+ function I teste

ID: 674198 • Letter: C

Question

can some one help me figure out what's wrong with my operator+ function I tested it in main using sortedListNode* operator+(sortedListNode &listl;, sortedListNode &list2;) sortedListNode *newList = NULL; sortedListNode *templ = &list1; sortedListNode *temp2 = &list2; while(temp! != NULL && temp2 != NULL) sortedListNode *newNode new sortedListNode; if(templ->lettertemp2->letter) sortedListNode *newNode = new sortedListNode; newNode->letter temp1->letter newNode-occurrences templ- occurrences templ temp1-next; else if(templ->letter > temp2->letter) newNode->letter temp2->letter; newNode-occurrences temp2- Soccurrences temp2 = temp2->next; else sortedListNode *newNode = new sortedListNode newNode->letter = temp!->letter;

Explanation / Answer

You declared it as list1 and and list2 but you are instead using list and list1

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote