/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <stdio.h>

int main()
{
    int i;
    int a[] = {1,22,333,4444,55555,666666,7777777,88888888,999999999};
    int size = 11*sizeof(a)/sizeof(int)+3;
    char buf[size]; // requires a C99 compliant compiler
    char *ptr = buf;
    *ptr = '{';
    ptr++;
    for(i = 0; i < sizeof(a)/sizeof(int); i++)
    {
        ptr += sprintf(ptr, "%d,", a[i]);
    }
    ptr--;
    *ptr = '}';
    printf("%s\n", buf);
    return 0;
}
