錯誤功能的realloc():無效指針爲什麼我的簡單代碼不能在C++中工作?
int indZero = 0;
int *perZero=NULL;
int zero = 0;//Initialization
ProcessBit(zero,&indZero,&perZero);// Call function
void ProcessBit(int num,int *ind,int **mas)
{
mas=(int**)realloc(&mas,((*ind))*sizeof(int));// Error
mas[num-1]++;//it's correct line
}
另外,這段代碼不在C++中,它在C中。 –