Advertisement
vimja

Untitled

Jul 10th, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. // Copyright (c) 2012 by Bash Vi
  2. // This code is released under the terms
  3. // of the WTFPL (What the Fuck Pulic License) version 2.0
  4. // http://sam.zoy.org/wtfpl/
  5.  
  6. // Converts first character from arguments
  7. // into a string of 1es and 0es
  8. // ( ASCII value of the character)
  9. #include <bitset>
  10. #include <string.h>
  11. #include <iostream>
  12. #include <cstring>
  13.  
  14. using namespace std;
  15.  
  16. int main(int ac, char* av[])
  17. {
  18.   bitset<8> bs;
  19.   memcpy(&bs, av[1], 1);
  20.   cout << bs << endl;
  21.  
  22.   return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement