读书人

请教这三句JAVA怎么转换成VC代码?不明

发布时间: 2012-03-24 14:00:46 作者: rapoo

请问这三句JAVA如何转换成VC代码?不明白是什么意思?

Java code
int i, accumulator;String returnValue = new String();returnValue = Integer.toHexString(accumulator).toUpperCase();


[解决办法]
int accumulator;
CString returnValue ;
returnValue.Format(_T("%X"),accumulator);

returnValue = Integer.toHexString(accumulator).toUpperCase();
应该是将accumulator转为16进制大写

[解决办法]
C/C++ code
很像TCHAR buf[ 0x100 ];_stprintf( buf, _T( "%.2X" ), acc );
[解决办法]
探讨
如果用CString的returnValue.Format(_T("%X"),accumulator);可以吗?

[解决办法]
探讨
如果用CString的returnValue.Format(_T("%X"),accumulator);可以吗?

读书人网 >VC/MFC

热点推荐