19.03.2013, 20:53
Hello,
what is return in strval() when:
new value = strval("test");
?
Thanks
what is return in strval() when:
new value = strval("test");
?
Thanks
#include <a_samp>
main() { printf("value: %i", strval("test")); }
IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
return 1;
}
stock isnumeric(str[])
{
new
ch,
i;
while ((ch = str[i++])) if (!('0' <= ch <= '9')) return 0;
return 1;
}
I recommend using the version from y_utils as it's about 3 times as fast (Benchmarked with 10000 loops, your version took 9ms while this one only 3ms - the difference is pretty unnoticable, but still):
pawn Код:
|