int to string

#include <iostream>
using namespace std;

char* Int2String(int nData)
{
 char szBuffer[1024] = {0};
 sprintf(szBuffer,"%d",nData );
 return szBuffer;
}

void main()
{
 cout<<Int2String(4546)<<endl;
 getchar();
} 


 

posted @ 2011-10-19 23:50  byfei  阅读(164)  评论(0编辑  收藏  举报