开发者

How can convert System::Int32 to wchar_t*

开发者 https://www.devze.com 2023-03-06 16:44 出处:网络
I have this piece of code: int casted_dbValue=3; wchar_t* nativeData=(wchar_t*)casted_dbValue; it is incorrect conversion between int to const wchar_t*. How can de开发者_运维百科al with this error?

I have this piece of code:

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

it is incorrect conversion between int to const wchar_t*. How can de开发者_运维百科al with this error?


Have you tried the _itow function?

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

Or, the more secure version, _itow_s.

The first parameter (value) is the integer value to be converted, the second is the string result, and the third is the base of the numeric value. It returns a pointer to the str value.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号