The real problem is, how can I compare the 38 that I have like 2 characters from the string
Converting the string "38" to an int, using atoi() won't help because the string is assumed to be in base 10, not base 16.
You need to convert each character to a int yourself, knowing that it is base 16. If the character is between '0' and '9', the value is the character minus '0' ('3' - '0' = 3). If the character is between 'A' and 'F', the value is the character minus 'A' plus 10 ('D' - 'A' + 10 = 14). Then, multiply the first value by 16 and add the second value.
Then, you can compare that value to the value in CheckSum.