fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. FILE *fp;
  7. unsigned int value = 0, tmp = 0;
  8.  
  9. fp = fopen("C:\\Users\\james732\\Desktop\\1.txt", "r");
  10.  
  11. fscanf(fp, "%X:", &tmp);
  12. value += tmp;
  13. value <<= 8;
  14.  
  15. fscanf(fp, "%X:", &tmp);
  16. value += tmp;
  17. value <<= 8;
  18.  
  19. fscanf(fp, "%X:", &tmp);
  20. value += tmp;
  21. value <<= 8;
  22.  
  23. fscanf(fp, "%X:", &tmp);
  24. value += tmp;
  25.  
  26. printf("%08X, %d\n", value, value);
  27.  
  28. fclose(fp);
  29. return 0;
  30. }
  31.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty