[win32]int与LPCWSTR之间的转换


#include <stdlib.h>
#include <tchar.h>
void test3()
{
	// LPCWSTR to int
	LPCWSTR wstr=L"234";
	std::wstring tempstr(wstr);
	int val=_wtoi(tempstr.c_str());
	
	//int to LPCWSTR
	int itemp=123;
	wchar_t str[10];
	_itow_s(itemp,str,10);
	//int to LPCWSTR
	int age=50;
	wchar_t ch[20];
	_stprintf_s(ch,L"%d",age);
}

你可能感兴趣的:([win32]int与LPCWSTR之间的转换)