Monday, January 31, 2011

C++ ASCII Biner

#include <kc32>
#include <iomanip>
void main()
{
 char ch,lh;
 int n=0;
 for (int i = 0; i <= 255;i++)
 { (i==8)||(i==9)||(i==10)||(i==13)?ch = ' ':ch = i;
   if (n==3)
   { lh = '\n';
     n = 0; }
    else
      { lh = '|';
        n++; };
   cout << "  " << setw(8) << setbase(2) << i << ' ' << setw(2) << hex
   << i << ' ' << setw(3) << dec << i << " [" << ch << "]  " << lh;
 }
 pause;
}

No comments:

Post a Comment