#include <iostream> #include <stdio.h> #include <string.h> #include <stdlib.h> using namespace std; int main(){ unsigned char s[] = {255,255,0,0,1,1}; char str[20]; sprintf(str,"%02X,%02X,%02X,%02X,%02X,%02X",s[0],s[1],s[2],s[3],s[4],s[5]); cout << str << '\n'; return 0; }
FF,FF,00,00,01,01 (出力)