mikroC

mikroC - C Compiler for Microchip PIC microcontrollers

making it simple...

ShortToStr

Prototype

void ShortToStr(short number, char *output);

 

 

Description

Function creates an output string out of a small signed number (numerical value less

 

than 0x100). Output string has fixed width of 4 characters; remaining positions on the

 

left (if any) are filled with blanks.

 

 

Example

short t = -24;

 

char *txt;

 

//...

 

ByteToStr(t, txt); // txt is " -24" (one blank here)

 

 

WordToStr

Prototype

void WordToStr(unsigned number, char *output);

 

 

Description

Function creates an output string out of an unsigned number (numerical value of

 

unsigned type). Output string has fixed width of 5 characters; remaining positions on

 

the left (if any) are filled with blanks.

 

 

Example

unsigned t = 437;

 

char *txt;

 

//...

 

WordToStr(t, txt); // txt is " 437" (two blanks here)

 

 

IntToStr

 

 

Prototype

void IntToStr(int number, char *output);

 

 

 

 

 

 

 

 

Description

Function creates an output string out of a signed number (numerical value of int

 

 

 

 

 

type). Output string has fixed width of 6 characters; remaining positions on the left (if

 

 

 

 

any) are filled with blanks.

 

 

 

 

 

 

 

 

Example

int j = -4220;

 

 

 

 

 

char *txt;

 

 

 

 

//...

 

 

 

 

 

IntToStr(j, txt); // txt is " -4220" (one blank here)

 

 

 

 

 

 

 

 

 

page

 

 

 

 

 

 

 

300

MikroElektronika: Development tools - Books - Compilers