Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Programming in C

Name: Anonymous 2012-01-15 23:50

sup /prog/,

I'm coding in C. I have an char array that looks like this: [0,1,1,0,0,0,1,1].

How can I write this into a binary or single char so that it'll be a single variable, i.e. b = 01100011?

And then convert that back into decimal?

Name: Anonymous 2012-01-16 0:06

>>1
You should use bitwise shift operators.

Initialize an unsigned variable to 0. Then in a loop bitwise or with the array's element and then shift.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List