hey all, i'm having troube searching this array to find identical matches. i though i had the logic figured out, but it's not working. thanks for your help.
Code:
#include <iostream.h>
#define draw 5
void f_pair (const char *face_card[]);
main()
{
const char *face_card [5]={"1", "2", "3", "1", "5"};
f_pair(face_card);
return (0);
}
void f_pair (const char *face_card[])
{ int j=1;
for (int i=0; i<draw-1; i++)
{
for (j+=i; j<draw;++j)
{ if (face_card[i]==face_card[j])
{ cout<<"you matched: "<<face_card[i]<<endl<<endl;
}else
cout<<"no match"<<endl;
}
}
}