std::vector<uint8_t> data{0x11, 0x22, 0x33, 0x99, 0xff}; std::ofstream ofs("test.txt", std::ios::app); for (int i = 0; i < data.size(); i++) { std::cout << std::hex << (int)data[i] << " "; } std::cout << std::endl; for (int i = 0; i < data.size(); i++) { std::cout << std::hex << (int)data[i] << " "; } std::cout << std::endl;
输出结果