-3
I am doing a college job in which I have to convert a received value to char so that I can write it out in full for example. Help me create this function.
-3
I am doing a college job in which I have to convert a received value to char so that I can write it out in full for example. Help me create this function.
1
A character can only represent a number from 0 to 9.
If you want to convert a number greater than 9 into a string
see: Converting int to string
Case really wanted a whole like char
, you can do it this way:
int main(int argc, char *argv[]) {
int inteiro = 1;
char caractere = inteiro+'0';
printf("%c",caractere);
return 0;
}
See more explanations: Converting int to char in C
Browser other questions tagged c string
You are not signed in. Login or sign up in order to post.
Shows us what you have tried (in code form) and where you have doubt..
– Caique Romero