Thanks for the help @laserlight. I appreciate it and I went with your first option (although I may change it to the arrays later) and it's almost perfect. The only problem now is that when either *drawSet or *usrSet has a number where the same digit appears twice (ex: 454) and it appears once in the other set (ex: 348) it counts it as two matches. The goal is to count once for each cross matched pair, not counting the same occurrence of a digit for a second time. Can this be done with changes to the current code or might there be an easier way to accomplish it?
Here's the code again with printf of the above stated results:
Code:
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int main()
{
int sysHunds=4,sysTens=5,sysOnes=4,usrHunds=3,usrTens=4,usrOnes=8,ds,us,matches=0;
int * drawSet[3]; int * usrSet[3];
drawSet[0] = &sysHunds;
drawSet[1] = &sysTens;
drawSet[2] = &sysOnes;
usrSet[0] = &usrHunds;
usrSet[1] = &usrTens;
usrSet[2] = &usrOnes;
printf("\n*drawSet: %d%d%d usrSet: %d%d%d\n", *drawSet[0], *drawSet[1], *drawSet[2], *usrSet[0], *usrSet[1], *usrSet[2]);
for (ds=0;ds<3;ds++) for (us=0;us<3;us++)
if (*drawSet[ds]==*usrSet[us]) matches++;
printf("\nThere are %d matching number(s)!\n", matches);
system("pause");
return 0;
}