#include #include int stack_create(int **top,int **bottom) { int m; printf("请输入栈的长度:"); scanf("%d",&m); *bottom=*top=(int *)malloc(sizeof(int)*m); printf("创建成功!\n"); return m; } void stack_in(int *top,int *len,int lenmax) { int n
请问为什么第一个参数要改呢?lenmax创建栈的时候就已经返回栈的长度了哟
int stack_create(int **top,int **bottom)
{
int m;
printf("请输入栈的长度:");
scanf("%d",&m);
*bottom=*top=(int *)malloc(sizeof(int)*m);
printf("创建成功!\n");
return m;
}
lenmax=stack_create(&top,&bottom);