if a got a int variable whit the numbers 1357 in it how can i make it to split so i get 1 in int x. 3 in int y.5 in int z.......

Printable View

- 03-14-2009sphinxenc++ variables
if a got a int variable whit the numbers 1357 in it how can i make it to split so i get 1 in int x. 3 in int y.5 in int z.......

- 03-14-2009Litz
Imagine the integer 123. Now imagine the integer 100.

Assuming the result is an integer value, what's the result of 123/100?

How about 123%10? - 03-14-2009sphinxen
thx :D one more question is there a way to calculate how many numbers there are in the int??

- 03-14-2009Litz
Take 123 as example again. If you do 123/1000, what's the result?

Now, isn't that the same as 123/10/10/10?

How many digits does 123 have?

How many divisions by 10 have you made? - 03-14-2009sphinxen
thx :P i feel little stupid that i couldn't figure that our for my self xD