0
how can I convert an integer into a character in c++??
2 Réponses
0
using static_cast you can convert a the data type of data
0
....
int i,tmp,j;
char c[100];
.....//input i
j=0;
while (i){
tmp=i%10;
i/=10;
c [j++]=tmp+48;
}
for (i=0;j>=0;i++,j--)
{
tmp=c [i];
c [i]=c[j];
c [j]=tmp;
}
c [i]='\0';
......