Strings and Numbers
#1

I have a long number, 674583948
I tried to use modifiers for variable but failed. When i tried to assign it directly to a variable

pawn Код:
new var = 674583948;
But it displayed some other number when i printed it. Then I tried to assign it to a string.

pawn Код:
new str[15];
format(str, 15, "674583948");
Then I tried to compare it with 777 and check if that number is equal using

pawn Код:
if(!strcmp(str, "777", true))
{
    //blah blah code here....
}
But the comparison always returns 0 which makes it enter the if condition.

How do I compare the numbers?
Reply


Messages In This Thread
Strings and Numbers - by deather - 15.03.2011, 13:08
Re: Strings and Numbers - by Voldemort - 15.03.2011, 13:09
Re: Strings and Numbers - by deather - 15.03.2011, 13:12
Re: Strings and Numbers - by deather - 17.03.2011, 11:59
Re: Strings and Numbers - by deather - 17.03.2011, 12:15
AW: Re: Strings and Numbers - by Nero_3D - 17.03.2011, 12:47

Forum Jump:


Users browsing this thread: 1 Guest(s)