How can I convert numbers that are combined with - into a string.
I need to make all those numbers including the - into one string.
but it doesn't seem to work.
A character is typically just that, one character. Not seven.
You can do a wide character:
char what = '12-4-30';
but I think that's more bits than most compilers will let you have in a
char, so it's not going to work.
If you meant a string of character, you should use
char what; snprintf(what, sizeof what, "%d-%d-%d", 12, 4, 30); printf("built string: '%s'\n", what);