View Single Post
Old 10-30-2006, 01:46 PM   #3 (permalink)
toe_cutter
Code Monkey
 
Join Date: Aug 2002
Location: Boston, MA
Posts: 79
toe_cutter is on a distinguished road
Send a message via ICQ to toe_cutter Send a message via AIM to toe_cutter Send a message via Yahoo to toe_cutter
Code:
void printBin( long long var ) {
  int i;

  for (i=11; i>=0; i--)
    printf("%d", (var >> i) & 1);
  putchar('\n');
}
Opps this is in C, but should work similar in c++.
__________________
toe_cutter is offline   Reply With Quote