[Off] Desafio - Faзa sua prуpria funзгo
#4

pawn Код:
stock Strcmp ( string1[] , string2[] )
{
    new
        a = strlen ( string1 ),
        b = strlen ( string2 ),
        result = ( a > b ) ? b : a;
   
    for ( new i ; i < result ; ++ i )
    {
        if ( string1 [ i ] != string2 [ i ] )
            return true;
    }
   
    return false;
}
Retorna true se for diferente
Retorna false se for igual
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)