otoa(3C)
_________________________________________________________________
otoa function
Convert an integer to an octal character string.
_________________________________________________________________
Calling Sequence
char *otoa(), *octnum, *result;
int num;
result = otoa(num, octnum);
Description
Use the otoa function to convert an integer to an octal character
string.
Returns
The otoa function returns the address of the octal string.
Related Functions
See also the atof, atoi, atol, and itoa functions.
Example
/* Program test for the otoa() macro */
char *otoa();
int i = 1, num;
char octnum[12];
main(argc, argv)
int argc;
char *argv[];
{
printf("\tDecimal\t\tOctal\n\n");
while (i < argc) {
num = atoi(argv[i]);
printf("\t%d\t=\t%s\n", num,
otoa(num, octnum));
i++;
}
}
A call to the program test with the numbers 66, 77, 88, and 99
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
otoa(3C)
generates the output
Decimal Octal
66 = 102
77 = 115
88 = 130
99 = 143
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)