Home > Back-end >  C: how will be in the form of hexadecimal string, converted to the same hexadecimal integer.
C: how will be in the form of hexadecimal string, converted to the same hexadecimal integer.

Time:03-15

How to will be in the form of hexadecimal string, converted to the same hexadecimal integer,

For example: "0" x123 string into hex 0 x123 also,

CodePudding user response:

Fyi:
 # include & lt; stdio.h> 

Int main (void)
{
Char * STR="0 x123";
The int data;
Sscanf (STR, "% x", & amp; The data);
Printf (" % # x \ n ", data);

return 0;
}
  • Related