convert char

hi all,
I want ack about converting more like this element of array to one string...
array[num]
for example, I've similar of this arrays
array[1]=1;
array[2]=2;
array[3]=3;
array[4]=4;
and I did need value from arrar[1-4] per one printf.
currently i use it
printf("%s",array[num], (num=3) ? '\n' : '.');
So, I want decrease quantity of printf syscalls and print either string per one printf.

so use sprintf to buffer first
but printf is buffered output that outputs only the line when \n is sent (or fflush(stdout) is called)

Ok, then suppose to me, please how to do it most good. Me need four values separate of point. What's way will be of most good? I can do int by 'switch' or forest of 'if', but I think what that not quite good.

I did defined a struct and and call from 0 to 3 char number, but I did need put that with separator similar of this...
1.2.3.4
Were numbers from 1 to 4 it's just char values from 0 to 3 char number.
__
thank in advance.

If I doing which's I sampled, than I've got point on end of line.
1.2.3.4.
but me need that
1.2.3.4
Were numbers from 1 to 4 it's just char values, from 0 to 3 char numbers. A point it's the separator.

I did defined a struct and and call from 0 to 3 char number, but I did need put that with separator similar of this...
1.2.3.4
Were numbers from 1 to 4 it's just char values from 0 to 3 char number.
__
thank in advance.

So, well. That's certainly not how sprintf works, even if you spelled it correctly, and we certainly can't use += with C strings; nor can we be sure whether your str variable is a char [] (good) or just a char * (bad, or at least requiring more work). Just use one sprintf call with the format the way you want it (that's what the formatted output functions are for, after all). If you feel the need to use a loop for whatever reason, then you can just replace the period with a new-line after the loop.

Again, it's not called "sprtinf". Look at how sprintf works -- sprintf(arr[num], sizeof(arr[num])) is most assuredly not how it works even if you spelled it correctly -- sprintf works just like printf except the first argument is the string to print to. You also seem to think "p->str" means something; it does not.