I'd like to compare a few variables to see whether they match a certain number if strung together for example

Any help is greatly appriciated.Code:`if (("%d%d%d", first, second, beg) == "2000");`

- 09-22-2008redruby147testing multiple int alongside one another to see if they match a number
I'd like to compare a few variables to see whether they match a certain number if strung together for example

Code:`if (("%d%d%d", first, second, beg) == "2000");`

- 09-22-2008laserlight
One approach is to convert them to strings, concatenate the strings, then compare the final result to the other number as a string.

Another approach is to use mathematics: add the numbers up and compare. The limitation of course, is in the range of whatever type is used (and you have to either assume that the numbers are in the range [0,9] or it gets tricky).