urjaman
"I Know. We're going for a ride."
OT, But heres to the community
It is now proven that to read the forums, one needs programming skills....
(I know that this utility propably already existed. It was more fun to write than to search for.)
EDIT:spoiler, because of offtopic post
Code:
#include <stdio.h>
#include <stdlib.h>
char* take_binchar(char* in, char*out) {
int i=0;
char c=0;
if (!in) return NULL;
if (!out) return NULL;
for (; ;) {
char w;
w = *in;
if (w == 0) return NULL;
if ((w != '0')&&(w != '1')) {
in++; continue;
}
if (w == '1') {
c |= (1<<(7 - i));
}
i++;
in++;
if (i==8) {
*out = c;
return in;
}
}
}
int main(int argc, char** argv) {
int i;
char *ptr;
for(i=1;i<argc;i++) {
ptr = argv[i];
for(; ;) {
char c;
ptr = take_binchar(ptr,&c);
if (ptr) {
printf("%c",c);
} else {
break;
}
}
}
printf("\n");
return 0;
}
(I know that this utility propably already existed. It was more fun to write than to search for.)
EDIT:spoiler, because of offtopic post