Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help figuring out the bug to this function and then debug it. here is a screen shot of the code with the result.
I need help figuring out the bug to this function and then debug it. here is a screen shot of the code with the result. I believe there is a "segmentation fault ".
this is what the desired output is supposed to be
so my main questions are
1) what's causing the segmentation default? 2) what is the bug and the solution to the function?
thank you
3 typedef struct node t int val; struct node next; 6 node; 8FIXNE: this function ts buggy, / 9 int equal(cons node b) ( st node a, const if (a-val I 6.val) 12 13 14 15 return 0 a anext b bnext 16 7 tsts are equal if a and b are both null 17 return b 18 19 20/ The matn function extsts just to test 11 equat 21 There are two tests. The second one is by defautt 22 buggy. Please find the error and fix tti/ 23- int nathint arge, char** argv) ( 24 int ti 25 node nodes[10] 26 27 for (L 0; tStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started