我想转换TCHAR nameBuf[]
成string
.
TCHAR nameBuf[MAX_COMPUTERNAME_LENGTH + 2];
DWORD nameBufSize;
nameBufSize = sizeof nameBuf - 1;
GetComputerName(nameBuf, &nameBufSize); //store computer name into nameBuf
_tprintf(_T("%s"), nameBuf); //print the computer name