Hex

I saw a function where it gets the character's hex value.

What is the meaning of this %02x ?
pearl1Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
deightonConnect With a Mentor Commented:
BTW 0 - means padw with zeroes
        2 - means length 2
        x or X means lower or capital Hexadecimal letters.
0
 
deightonCommented:
used in printf type control string.

Outputs value in hexadecimal, length two with leading zeroes.  letters are in lower case

printf("%02x",11);
out put is

0b
0
 
PacmanCommented:
BTW: 2 means MINIMUM length of 2 characters ...
0
Live webcast with Pinal Dave

Pinal Dave will teach you tricks to help identify the real root cause of database problems rather than red herrings. Attendees will learn scripts that they can use in their environment to immediately figure out their performance Blame Shifters and fix them quickly.

 
ozoCommented:
perldoc -f sprintf
0
 
ozoCommented:
Sorry, wrong Topic Area.
0
 
pearl1Author Commented:
Thanks a lot.
0
All Courses

From novice to tech pro — start learning today.