Link Details

Link 1137755 thumbnail
User 551991 avatar

By macosxnerd101
Published: Apr 11 2014 / 05:36

So you want to display a number as a Binary String? Well, lucky for us, the CPU only understands and deals with Binary numbers (Everything is Binary in the CPU, Letters, Numbers, Strings, etc..). In this example, I will use the number 89, in Binary that is 01011001 which is also the ASCII Code for the letter "Y". We need a buffer large enough to hold the Binary ASCII String + a Carrage Return (ASCII 10), since we will be converting an 8-bit number, a 9 byte buffer will be large enough.
  • 8
  • 0
  • 419
  • 872

Add your comment

Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (8)

Voters Against This Link (0)

    Java Performance Optimization
    Written by: Pierre-Hugues Charbonneau
    Featured Refcardz: Top Refcardz:
    1. Design Patterns
    2. OO JS
    3. Cont. Delivery
    4. Java EE7
    5. HTML5 Mobile
    1. Node.js
    2. Debugging JavaScript
    3. OO JS
    4. JSON
    5. Ajax