You do realise my program does the comparison between the 2 file extensions?

The 16 is difference between them. Look at the line
>return ((strcmp (p1, p2)));
At this point p1 and p2 point to the file extensions in each filename.