我遇到了结构问题.在每个函数声明之前,我收到有关标识符的错误.错误发生在'typedef','coords stackCreate'和'coords stackPush'之前
typedef struct coords * coordPtr
{
int x = -1;
int y = -1;
struct coords * next;
};
coords stackCreate(int x, int y){
coordPtr stack = malloc(sizeof(coords));
stack->x = x;
stack->y = y;
return stack;
}
coords stackPush(int x, int y, coords stack){
stack->next = malloc(sizeof(coords));
stack->next->x = x;
stack->next->y = y;
}
Run Code Online (Sandbox Code Playgroud)
感谢您的任何帮助!