Skip to main content
 

There are C functions that can convert text to number. For example, strtol() or atoi(). Here is a little snippet to get you started:

char *str = "FF";
char *ptr;
int result = strtol(str, &ptr, 16); //the 16 is the base the string is in (HEX -> base 16)

char *str = "FF";
char *ptr;
int result = strtol(str, &ptr, 16); //the 16 is the base the string is in (HEX -> base 16)

result will have 0xFF or 255 by the end. You can use this to achieve what you are trying to do. Take a look at this for functions you can use to manage your String.

There are C functions that can convert text to number. For example, strtol() or atoi(). Here is a little snippet to get you started:

char *str = "FF";
char *ptr;
int result = strtol(str, &ptr, 16); //the 16 is the base the string is in (HEX -> base 16)

result will have 0xFF or 255 by the end. You can use this to achieve what you are trying to do. Take a look at this for functions you can use to manage your String.

 

There are C functions that can convert text to number. For example, strtol() or atoi(). Here is a little snippet to get you started:

char *str = "FF";
char *ptr;
int result = strtol(str, &ptr, 16); //the 16 is the base the string is in (HEX -> base 16)

result will have 0xFF or 255 by the end. You can use this to achieve what you are trying to do. Take a look at this for functions you can use to manage your String.

Source Link

There are C functions that can convert text to number. For example, strtol() or atoi(). Here is a little snippet to get you started:

char *str = "FF";
char *ptr;
int result = strtol(str, &ptr, 16); //the 16 is the base the string is in (HEX -> base 16)

result will have 0xFF or 255 by the end. You can use this to achieve what you are trying to do. Take a look at this for functions you can use to manage your String.