User manual
722
mikoC PRO for dsPIC
MikroElektronika
WordToHex
Prototype
void WordToHex(unsigned input, char *output);
Description Converts input number to a string containing the number’s hexadecimal representation. The output
string has xed width of 5 characters including null character at the end (string termination).
Parameters
- input: unsigned integer to be converted
- output: destination string
Returns Nothing.
Requires Destination string should be at least 5 characters in length.
Example
unsigned t = 1111;
char txt[5];
...
WordToHex(t, txt); // txt is “0457”
Notes None.
IntToHex
Prototype
void IntToHex(int input, char *output);
Description Converts input number to a string containing the number’s hexadecimal representation. The output
string has xed width of 5 characters including null character at the end (string termination).
Parameters
- input: signed integer number to be converted
- output: destination string
Returns Nothing.
Requires Destination string should be at least 5 characters in length.
Example
int j = -32768;
char txt[5];
...
IntToHex(j, txt); // txt is “8000”
Notes None.