2011年2月1日星期二

int2str

const char* Int2Str(int num) {
 static char string[50];
 int count=1;
 int temp=num;
 int i=0;
 while(num=num/10){
  count++;
 }
 while(count)
 {
  string[count-1]= 48+temp%10;
 temp=temp/10;
 count--;
 }
 return string;
}

没有评论:

发表评论