为什么segmentation fault?

问题遇到的现象和发生背景

为什么 stack Creatstack()那里出现Segmentation fault?

问题相关代码,请勿粘贴截图

#include <stdio.h>
#define MAXSIZE 10

typedef struct _stack *stack;
struct _stack{
int st[MAXSIZE];
int top1;
int top2;
};

int main(){
stack s1 = Creatstack();
return 0;
}

stack Creatstack(void){
stack s;
(s->top1)=1;
(s->top2)=MAXSIZE;
return s;
}

stack s,这里的s是指针类型啊,你得先分配空间,然后才能给结构成员赋值
stack s = (stack)malloc(sizeof(struct _stack));