C Programming Tutorial 82, Generic Linear Search

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Not many people have made it thus far...
Adam thank you for your dedication.

skittleluver
Автор

this is nice Adam we looking even more pro now! with slides

thewhisperinyourears
Автор

One should never rely on converting struct fractions into decimals to test for equality, because that will (often) create approximations to those fractions. A better approach is to cross multiply and see if the product of the means matches the product of the extremes. 
i.e.
int compareFractions(void* vp1, void* vp2) {
       fraction* fp1 = (fraction*) vp1, *fp2 = (fraction*)vp2;
       
       return fp1->num * fp2->denom - fp1->denom * fp2->num;
}

arimermelstein
Автор

plz reply why we can't use == operators in fraction i just tried a code in which i was able to use these operators 

AbhimanyuAryan
visit shbcf.ru