Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Conversion

 
Javix Protocol
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to convert a decimal integer literal to octal and hexadecimal literal?
------------------
javix!
 
Jesper Ottosson
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the decimal number 20 is:
0x14 in hex
024 in oct
so just prefix with 0x when you want hexadecimal and 0 when you want octal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic