我试过使用三重指针,但它一直失败。代码:
#include <stdlib.h>
#include <stdio.h>
int set(int *** list) {
int count, i;
printf("Enter number:\n");
scanf("%d", &count);
(*list) = (int **) malloc ( sizeof (int) * count);
for ( i = 0; i<count;i++ ) {
(**list)[count] = 123;
}
return count;
}
int main ( int argc, char ** argv )
{
int ** list;
int count;
count = set(&list);
return 0;
}
感谢您的任何建议