how can i compare jagged array to another array in c?

You have the (inner) loop:

int *ptr = result[i];
for (int j = 0; j < size[k]; j++)
     if(ptr[j] == aux[j])

Since you increment both j and ptr, you’re doing far too much incrementing. It’s probably best to remove the ptr++; line.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top