我正在尝试将一些内存分配为 unsigned char* 但是当我这样做时,指针似乎没有被初始化!
unsigned char* split = (unsigned char*) malloc ((sizeof(unsigned char)*sizeof(unsigned int)));
memset(&split,0,sizeof(int));
if(split==NULL) {
std::cout<<"Unable to allocate memory!\n";
system("pause");
return 1;
}
但是,每次我运行时都会收到错误消息。无论我使用什么数据类型,它似乎都会发生!