[Solved] How to Convert int into char string


What?

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 snprintf():

char what[32];

snprintf(what, sizeof what, "%d-%d-%d", 12, 4, 30);
printf("built string: '%s'\n", what);

solved How to Convert int into char string