You can use itoa to convert an integer to a string.
You can use the strcat function to add characters to a line at the end of another line.
If you want to convert an integer to a character, just follow these steps:
int a = 65; char c = (char) a;
Please note that since characters are smaller than an integer, this casting can lead to data loss. It is better to declare the character variable as unsigned in this case (although you can still lose data).
To make an easy reading about type conversion, go here .
If you still have problems, please comment on this answer.
Edit
Go here for a more suitable example of combining characters.
Also a more detailed link is given below -
Second edit
char msg[200]; int msgLength; char rankString[200]; ...........
Third editor
Go to this link . Here you will find the implementation of itoa . Use this instead.
MD Sayem Ahmed
source share