Link Details

Link 1137755 thumbnail
User 551991 avatar

By macosxnerd101
via dreamincode.net
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
  • 450
  • 877

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)



    Apache Hadoop
    Written by: Piotr Krewski
    Featured Refcardz: Top Refcardz:
    1. Play
    2. Akka
    3. Design Patterns
    4. OO JS
    5. Cont. Delivery
    1. Play
    2. Java Performance
    3. Akka
    4. REST
    5. Java