Advertisement
Darksider3

Untitled

Sep 9th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. int main(int argc, char** argv)
  4. {
  5.   if(argc ==1)
  6.   {
  7.     std::cout << "no argument given; exiting...";
  8.   }
  9.   unsigned int i=0,len=8;
  10.   std::cout << argv[1][0] << ": ";
  11.   while(len>i)
  12.   {
  13.     if((argv[1][0]&(i<<0)))
  14.     {
  15.       std::cout << "1";
  16.     }
  17.     else
  18.     {
  19.       std::cout << "0";
  20.     }
  21.     ++i;
  22.   }
  23.   std::cout << std::endl;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement