Datasheet

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