home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 1
/
FishNMoreVol1.bin
/
more
/
code_examples
/
librar
/
int2asc.c
< prev
next >
Wrap
Text File
|
1989-02-08
|
640b
|
25 lines
/*--------------------------------------*/
/* */
/* INT2ASC(X,X) */
/* */
/* Puts an integer given in the first */
/* argument into a character array given*/
/* in the second argument. */
/* */
/*--------------------------------------*/
void int2asc(a,r,num)
char r[];
int a,num;
{
int e,j;
double pow(),dd,P,ten;
P=a;
ten=10.0;
for (j=0;j<num;j++){
dd=num-j-1;
dd=pow(ten,dd);
e=a/dd;
r[j]=e+48;
a-=dd*e;
}
}