Sir pls tell whats the error in my code
@Vaibhav277
Actually the problem is temp1 pointer. See in line no. 45 to declare temp1=head1 = NULL (because head1 is NULL at that time). So when you try to check temp1->next in line no 62, it would give segmentation fault because temp1 is NULL and it’s next doesn’t exist.
Simply cur line no. 45 ans paste it after line 60. You code will work.
okay thank you sir…
1 Like