Datasheet

ByteToStr
ShortToStr
562
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
Prototype
void ByteToStr(unsigned short input, char *output);
Returns Nothing.
Description
Converts input byte to a string. The output string has fixed width of 4 characters
including null character at the end (string termination). The output string is right
justified and remaining positions on the left (if any) are filled with blanks.
Parameters :
- input: byte to be converted
- output: destination string
Requires Destination string should be at least 4 characters in length.
Example
unsigned short t = 24;
char txt[4];
...
ByteToStr(t, txt); // txt is " 24" (one blank here)
Prototype
void ShortToStr(short input, char *output);
Returns Nothing.
Description
Converts input signed short number to a string. The output string has fixed width
of 5 characters including null character at the end (string termination). The out-
put string is right justified and remaining positions on the left (if any) are filled
with blanks.
Parameters :
-
input: signed short number to be converted
- output: destination string
Requires Destination string should be at least 5 characters in length.
Example
short t = -24;
char txt[5];
...
ShortToStr(t, txt); // txt is " -24" (one blank here)