plzz help me to solve this problem....i hav tried but there are many errors....
#include<iostream>
#include<string>
using namespace std;
class matchMaker
{
public:
string rtn[] getBestMatches(string members[], string currentUser, int sf)
{
int i=0,scount=0,x;
string rtn[10]={0};
for(i=0;i<20 && scount<2;i++)
{
if(currentUser[i]!=' ' && scount<2)
continue ;
else
scount++;
}
int j=0;
for(j=0;j<6;j++)
{
int a,sc=0,tsf=0;
for(a=0;a<20 && sc<2;a++)
{
if(members[j][a]!=' ' && sc<2)
continue ;
else
sc++ ;
}
if(currentUser[i]!=members[j][a])
{
int p;
int temp=a;
for(p=0;p<((members[j].length)-temp);p++)
{
a=a+2;
i=i+2;
if(currentUser[i]==members[j][a])
tsf++;
}
}
if(tsf==sf)
rtn[x]=members[j];
x++;
}
return rtn;
}
};
int main()
{
matchMaker maObj;
string str[7]={ "TOM M F A D C A",
"SUE F M D D D D",
"ELLEN F M A A C A",
"JOE M F A A C A",
"ED M F A D D A",
"SALLY F M C D A B",
"MARGE F M A A C C"};
string user="BETTY F M A A C C";
maObj.getBestMatches(str,user,2);
return 0;
}