Are those two lines supposed to belong to the if, or just the one? (Your indentation needs work.)Code:if (head1->temperature>=1000 || head2->temperature>=1000) k=1; p=head2;Now keep in mind that you should be using different pointers for at least h2, so that you can get back to the start each time the inner loop starts again.Code:for each element in head1 for each element in head2 if head1->something == head2->something print it
Quzah.