GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: No Line Numbers


Binary-to-ASCII (precompiler) by DELTRON
1
 
// Simple binary to ASCII precompiler converter - Delt 1/18/2005

#include <stdio.h>

int b = 0xAA;    // binary number to convert to ASCII

void main(void)
{
    #define Z '0'+((b
    #define X &1
    char z[] = {Z>>7)X),Z>>6)X),Z>>5)X),Z>>4)X),Z>>3)X),Z>>2)X),Z>>1)X),'0'+(b&1),0};
    printf("%s\n",z);
}