I have int x
and char c
. I want to make a new string called str
as "x c"; so the int, a space, and the char.
So for example:
x = 5, c = 'k'
//concatenate int and char with a space in between.
so the line printf("%s", str)
will print:
5 k
How do I do this in C code?