fork download
  1. #define _POSIX_C_SOURCE 200809L
  2. #include <stdio.h>
  3. #include <stdint.h>
  4. #include <inttypes.h>
  5.  
  6. void leftshift(unsigned char *str,int nshiftleft, uint64_t *value)
  7. {
  8. uint64_t x = str[0];
  9. x = x << nshiftleft;
  10. *value = x;
  11. }
  12.  
  13. int main()
  14. {
  15. unsigned char s[] = { 'A', 0 };
  16. uint64_t result;
  17.  
  18. leftshift(s, 56, &result);
  19. printf("%" PRIx64 "\n", result);
  20. }
Success #stdin #stdout 0s 5292KB
stdin
Standard input is empty
stdout
4100000000000000