Created
July 24, 2019 15:50
-
-
Save jagannath-sahoo/4d980cb98e610d69590b7409b69c0058 to your computer and use it in GitHub Desktop.
Format Specifier for HEX BY Abdul ki magic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdint.h> | |
| char hex_string[2]; | |
| int main(void) | |
| { | |
| uint8_t check_sum = 242; | |
| sprintf(hex_string, "%02X", check_sum); | |
| for(int i=0; i<4;i++) | |
| printf("%c\n",hex_string[i]); | |
| printf("0: %s\n", hex_string); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment