Mikroelektronika MIKROE-738 Datenbogen

Seite von 682
632
mikoC PRO for PIC32
MikroElektronika
WordToStr
Prototype
void WordToStr(unsigned input, char *output);
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 
Returns
Nothing.
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)
Notes
None.
IntToStr
Prototype
void IntToStr(int input, char *output);
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 
Returns
Nothing.
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)
Notes
None.