fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void) {
  5.  
  6. char *dummy_password = "abc";
  7. printf("strlen:%d\n", strlen(dummy_password));
  8.  
  9. int dummy_password_int = 0;
  10.  
  11. for(int i = 0; i < strlen(dummy_password); ++i)
  12. {
  13. dummy_password_int |= (int)dummy_password[i] << (i * 8);
  14. printf("%d\n", (int)dummy_password[i] << (i * 8));
  15. }
  16.  
  17. //for(int i = 0; i < strlen(dummy_password); ++i)
  18. //{
  19.  
  20. // char chars = (char)(dummy_password_int >> (i * 8)) & 0xff;
  21. // printf("%c", chars);
  22. //}
  23. char chars = (char)(dummy_password_int & 0xff);
  24. printf("%c", chars);
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0s 5304KB
stdin
Standard input is empty
stdout
strlen:3
97
25088
6488064
a