Indeed sprintf is your friend. However sometimes you want to avoid linking whole stdio just for that. You might then want to use exec/RawDoFmt:
#include <proto/exec.h>
#include <proto/dos.h>
static const
UWORD stuffChar[] = {0x16c0, 0x4e75};
int main(void)
{
UBYTE string[256];
LONG array[2];
array[0] = (LONG) "Fish";
array[1] = 2;
RawDoFmt("%s have %ld eyes.", array, (void (*)(void)) &stuffChar, string);
PutStr(string);
PutStr("\n");
return 0;
}
However, please note that the default width of the %d, %u, %x and %c is 16-bit, not 32-bit as with printf functions. So you must use %ld, %lu, %lx and %lc if your array is LONGs. RawDoFmt is also limited in some other ways compared to sprintf. For simple stuff RawDoFmt is fine, however.