troubleshooting Question

multiple &&'s

Avatar of BrainDeadStudent
BrainDeadStudentFlag for United States of America asked on
Programming Languages-Other
22 Comments1 Solution486 ViewsLast Modified:
I am writing a program to compare and sort elements in an Array.  I am having much difficulty with printing my compare results. I can sort fine, but the compare is giving me trouble.  It doesn't seem to be completeing the &&'s.  Your help is appreciated!
I want this:
FMOR FORM
FMOR FROM
II am getting this:
FMOR CEFORS FORCES
FMOR EFGINOR FOREIGN
FMOR FMOR FORM
FMOR EFMORR FORMER
FMOR FMORS FORMS
FMOR ADFORRW FORWARD
FMOR DFNOU FOUND
FMOR FORU FOUR
FMOR EEFR FREE
FMOR DEEFMOR FREEDOM
FMOR CEFHNR FRENCH
FMOR DEFINR FRIEND
FMOR DEFINRS FRIENDS
FMOR FMOR FROM
FMOR FNORT FRONT
FMOR FLLU FULL
FMOR CFINNOTU FUNCTION
FMOR EFHRRTU FURTHER
FMOR EFRTUU FUTURE
using this code:
void findMatches(char* keys[],char* words[], int& count)
{       
	for (int keyIndex = 0; keyIndex < count; ++keyIndex)       
	{
		for (int keyIndex2 = 0; keyIndex2 < count; ++keyIndex2)       
		{
			if ((keys[keyIndex]&& keys[keyIndex2]==0) && (words[keyIndex]&& words[keyIndex2]!=0)) ;
			{                  
			out <<keys[keyIndex]<<" "<<keys[keyIndex2]<<" "<<words[keyIndex2]<<endl; 
				
			}                  
		}
	}
}
ASKER CERTIFIED SOLUTION
Hugh McCurdy

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 22 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 22 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros