The programs converts an integers into a string of its bits

const char* bits(unsigned int V)
{

unsigned int m = 1 << sizeof(V) * 8 – 1;

char* bitsV = new char[sizeof(V) * 8];
int i = 0;

while(m) {
bitsV[i] = 48+!!(V&m);
m = m >> 1;
i++;
}

bitsV[i] = ”;
return bitsV;
}