unsigned char*数组如何存储unsigned char*类型的数据
时间: 2023-11-18 18:03:52 浏览: 113
unsigned char数组转成string 用16进制表示
unsigned char*数组可以存储unsigned char*类型的数据。您可以使用memcpy函数将一个unsigned char*类型的数据复制到unsigned char*数组中。例如:unsigned char* array = new unsigned char[SIZE]; unsigned char* data = new unsigned char[SIZE]; memcpy(array, data, SIZE); 您还可以使用数组下标将一个unsigned char*类型的数据存储到unsigned char*数组中。例如:unsigned char* array = new unsigned char[SIZE]; unsigned char* data = new unsigned char[SIZE]; for (int i = 0; i < SIZE; i++) { array[i] = data[i]; }
阅读全文