-
-
怎么右移等于除10
-
发表于:
2014-5-19 23:34
6295
-
char* __cdecl NtIntToString(int _Val,char* _Str) //%d格式化
{
//int _Left = 0;
int _Right = 0;
int nLen = NtStrLen(_Str);
if(_Val < 0)
{
//_Val = abs(_Val);
__asm neg _Val //取反
_Str[nLen] = '-';
nLen++;
}
int nCount = 0;
do
{
_Right = _Val % 10;
_Str[nCount+nLen] = PsIntToChar(_Right,true);
nCount++;
_Val = _Val / 10;
}while(_Val);
_Str[nCount+nLen] = 0;
int nIndex = nCount / 2;
char cBuff = 0;
for(int i=0;i<nIndex;i++)
{
cBuff = _Str[i+nLen];
_Str[i+nLen] = _Str[(nCount-i-1)+nLen];
_Str[(nCount-i-1)+nLen] = cBuff;
}
return _Str;
}
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!