unsigned char c_Wifi[6]={0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; CString str = _T("BC:0F:2B:14:49:D9"); TCHAR seps[] = _T(":"); TCHAR* BT_token = _tcstok( (LPTSTR)(LPCTSTR)str, seps ); i=0; while( BT_token != NULL ) { CString BT_S; BT_S.Format(_T("0x%s"),BT_token); AfxMessageBox(BT_S); BT_token = _tcstok( NULL, seps ); i++; }
将BT_token的值存入到unsigned char中 或者将BT_S的值存入到unsigned char中
就VC 大神协助下
先转成char类型 在有char类型赋给Unsigned char