小弟我是一个才学习C语言的初学者写个一段代码编译后出错请各位大神看看,小弟我哪错了

我是一个才学习C语言的菜鸟写个一段代码编译后出错请各位大神看看,我哪错了


# include <stdio.h>
# include <malloc.h>
# include <stdlib.h>
struct man
{
int* line;
int size;
int value;
};
void Init(man* i,int len)
{
i->line=(int*)malloc(sizeof(int)*len);
if(i->line==NULL)
{
printf("Allocation failure\n");
exit(-1);
}
else
{
i->size=len;
i->value=0;
}
}
bool IsEmpty (man*i)
{
if(i->value==0)
return true;
else
return false;
}
void show_line(man*i)
{
if(IsEmpty(i))
printf("The array is empty\n");
else
{
for(int j=0;j<i->value;++j)
printf("%d",i->line[j]);
}
}
int main(void)
{
int len;
printf("Please enter the required length:");
scanf("%d",len);
man st;
Init(&st,len);
show_line(&st);
return 0;
}
------解决方案--------------------
倒数第六行“
scanf("%d",len);
改成:
scanf("%d", &len);