## Programming 3 "0x0" problem!

Put your programming skills to the test in these challenges.

### Programming 3 "0x0" problem!

i'm trying to solve prog 3... and don't know
What's "0x0"??!

\$int=0;
\$int+= '0x0'.'50';

its is now 80...

\$int=0;
\$int+= '0x0'.'100';

i don't understand?!?!?
nuclearhaxor
New User

Posts: 7
Joined: Mon Apr 14, 2008 4:07 pm
Blog: View Blog (0)

### Re: Programming 3 "0x0" problem!

I would have helped you but sorry i haven't completed this mission myself...

Challenges are not meant to be taken easily,rather they are meant to be taken Seriously
leonidas_heaven
Experienced User

Posts: 66
Joined: Sun Jun 01, 2008 5:20 am
Location: Uttarakhand,India
Blog: View Blog (0)

### Re: Programming 3 "0x0" problem!

PHP isnt very picky about numbers, strings and other data types.
'0x' in general is a Prefix for hexdecimal numbers in computing.

PHP sees this:
Code: Select all
`\$number = 12; # thats a number: 12\$string = '0x0' . \$number; # thats a string, "0x012"\$int = 0; \$int += \$string; # \$string is converted to integer, \$int is now 18 decimal or 0x12 hexdecimal`

That should be all you need to solve the rest - probably
BhaaL
Poster

Posts: 270
Joined: Sun Apr 13, 2008 11:16 am
Blog: View Blog (0)

### Re: Programming 3 "0x0" problem!

yes thankx a lot =)
nuclearhaxor
New User

Posts: 7
Joined: Mon Apr 14, 2008 4:07 pm
Blog: View Blog (0)