User manual

Table Of Contents
638
mikoC PRO for PIC32
MikroElektronika
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.
LongWordToHex
Prototype
void LongWordToHex(unsigned long input, char *output);
Description Converts input number to a string containing the number’s hexadecimal representation. The output
string has xed width of 9 characters including null character at the end (string termination).
Parameters - input: unsigned long integer number to be converted
- output: destination string
Returns Nothing.
Requires Destination string should be at least 9 characters in length.
Example
unsigned long jj = 65535;
char txt[9];
...
LongWordToHex(jj, txt); // txt is “0000FFFF”
Notes None.