please help me with this problem: i have to linked list, i need to compare them, and do something with regards to there result..

And? What's the problem? Presumably you're traversing both arrays to compare them and stopping when they're obviously different or at the end:

while ( a != NULL && b != NULL
  && a->data == b->data )
{
  a = a->next;
  b = b->next;
}

if ( a == NULL && b == NULL )
  /* They're equal */
else if ( a == NULL )
  /* a is smaller */
else if ( b == NULL )
  /* b is smaller */
else if ( a->data < b->data )
  /* a is smaller */
else if ( b->data < a->data )
  /* b is smaller */
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.