我正在使用动态数组,这是声明:
int *vetor = (int *) malloc (tam*sizeof(int));
vetorAleatorio (vetor, tam); //chamando função abaixo
但是当我尝试将它作为参数传递给这个函数时:
void vetorAleatorio(int **vet, int size) {
int i;
for (i=0; i<size; i++)
vet[i] = rand() %1000;}
我有以下错误:
[Warning] assignment makes pointer from integer without a cast
[Warning] passing arg 1 of `vetorAleatorio' from incompatible pointer type
有人知道这是怎么回事吗?