All pastes #361088 Raw Edit

dvd bioinfo

public c v1 · immutable
·published 2007-02-17 22:29 UTC
rendered paste body
#include <stdio.h>#include <stdlib.h>typedef struct {	unsigned int h:1;	unsigned int g:1;	unsigned int f:1;	unsigned int e:1;	unsigned int d:1;	unsigned int c:1;	unsigned int b:1;	unsigned int a:1;} Bits;char crossBits(char x, char y) {	char cross;	cross = (x >> 4) | (y << 4);	cross = (cross << 4) | (cross >> 4);	return cross;}void printBits(int x) {	Bits *bits;	bits=(Bits *)&x;	printf("%8d: %x %x %x %x | %x %x %x %x\n",x,bits->a,bits->b,bits->c,bits->d,bits->e,bits->f,bits->g,bits->h);}int main(int argc, char *argv[]) {	if (argc<3) exit(1);	printBits(atoi(argv[1]));	printBits(atoi(argv[2]));	printBits(crossBits(atoi(argv[1]),atoi(argv[2]) ) );	return(0);}