64,649
社区成员
发帖
与我相关
我的任务
分享
char Real[128] = "F2F10B000001F3";
string sfvalue = RealData;
#include <stdio.h>
#include <iostream>
#include <string>
using namespace std;
char Real[128] = { 0xF2,0xF1,0x0B,0x00,0x00,0x01,0xF3,0xF1,0xF3,0xF2,0xF3,0xF3,0x01,0x02,0x47,0x1E };
int i,L=16;
char hexstr[260];
string sfvalue;
int main() {
for (i=0;i<L;i++) sprintf(hexstr+i*2,"%.2X",(unsigned char)Real[i]);
hexstr[L*2]=0;
sfvalue=string(hexstr);
cout<<"["<<sfvalue<<"]"<<endl;//[F2F10B000001F3F1F3F2F3F30102471E]
return 0;
}
char Real[128] = "F2F10B000001F3";
string sfvalue = Real;