faqts : Computers : Programming : Languages : PHP : Database Backed Sites : MySQL : Questions in search of an Answer

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

1 of 4 people (25%) answered Yes
Recently 1 of 4 people (25%) answered Yes

Entry

How can I get the binary, 8 bit-string of a char ? i.e. chr(255) = 10101010

Jul 9th, 2001 07:15
Ivan L., Test Man, Onno Benschop,


printf("the binary representation of character %c is %b",87,87);
use sprintf("%b",87) to get a string containing that representation.