DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦b1ad08b56⟧ TextFile

    Length: 362 (0x16a)
    Types: TextFile
    Notes: UNIX file
    Names: »itoa.c«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦2d53db1df⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »frankh/lib/itoa.c« 

TextFile

/*
 *  Convert interger to ascii string ( leading zeros )
 *  five places.
z */

#include	<flib.h>

char *itoa(in, strng)
unsigned int in;
char *strng;
{
register int i;
unsigned int p;
	p = 10000;
	strng[0] = 32; 		/* lead off with a blank	*/
	for(i = 1; i != 6; ++i) {
		strng[i] = in / p + 0x30;
		in = in - ( in / p ) * p;
		p = p / 10;
	}
	return(strng);
}