Its a pretty old question. I want to insert an integer in a character array.
Eg:
int a=10;
char c[100];
EDIT: Suppose I have a character array “char c[20];”. I want to put numbers in the array.
Like:
c[0]='1';
c[1]='9';
c[2]='x';
on printing the output should be ’19x’;
PS: I don’t want ascii equivalent of integers to be inserted in array.
In Java you can use a StringBuilder as your character array
If you want just a string with the number you can use
or
e.g.