0

我有这段代码:

int casted_dbValue=3;
wchar_t* nativeData=(wchar_t*)casted_dbValue;

int到 const之间的转换不正确wchar_t*。如何处理这个错误?

4

1 回答 1

2

你试过这个_itow功能吗?

wchar_t * _itow(
                int value,
                wchar_t *str,
                int radix
                );

或者,更安全的版本,_itow_s.

第一个参数(value)是要转换的整数值,第二个是字符串结果,第三个是数值的基数。它返回一个指向该str值的指针。

于 2011-05-17T10:48:57.807 回答