28.10.2014, 21:16
Quote:
|
Thank you very much, this works
Btw what do you mean with store it into a 32-bit cel? And how would I convert a string into different integers if there were more values than just 0 and 1, let's say 1, 2, 3? (+Rep btw) |
Lets recreate this number 1100001000000000000000001
pawn Код:
new variable = 0;
variable |= 1 << 0; // it starts from the right with 0
variable |= 1 << 18;
variable |= 1 << 23;
variable |= 1 << 24;
printf("0b%b", variable); // prints 0b1100001000000000000000001
If you just want to convert a number within string to an integer than subtract the value of the character '0' fromt it
It should be clear if you look at the ASCII table ('0' represents 48 or 0x30)


