fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int i;
  5. int xor = 0;
  6. int b;
  7. // $GPGLL,,,,,,V,N*64
  8.  
  9. char Received[18]= {'$','G','P','G','L','L',',',',',',',',',',',',','V',',','N','*','6','4'};
  10. int loop;
  11.  
  12. // display array
  13. //for(loop = 0; loop < 18; loop++)
  14. // printf("%c ", Received[loop]);
  15.  
  16. for(int i = 1; i<=14; i++)
  17. xor ^= Received[i];
  18. printf("%#02x ", xor,"%d ", xor);
  19. printf("%d ", xor);
  20. b = Received[16];
  21. printf("%c ", b);
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
0x64  100 6