把double型数据存入到unsigned char型的数组中
#include "iostream"#include "cstdio"using namespace std;int main(){ unsigned char str[128]; double x = 12.255; double y = 45.25; sprintf((char*)str, "%f %f", x, y);