I have to convert code from c++ to c# for my job.
I almost finished , but I have some problem with next function:
double sprod_ss(SVECTOR *a, SVECTOR *B)/>
{
register double sum=0;
register WORD *ai,*bj;
ai=a->words;
bj=b->words;
while (ai->wnum && bj->wnum) {
if(ai->wnum > bj->wnum) {
bj++;
}
else if (ai->wnum < bj->wnum) {
ai++;
}
else {
sum+=(ai->weight) * (bj->weight);
ai++;
bj++;
}
}
return((double)sum);
My problem is in "while" loop. Since in my conversation of classes a->words is a List<Word> type a cant use
while (ai->wnum && bj->wnum)I tried a different ways to convert but the program does not work as well.
Any help
Thanks

New Topic/Question
Reply



MultiQuote


|