小编Ian*_*ker的帖子

预期标识符 - C.

我遇到了结构问题.在每个函数声明之前,我收到有关标识符的错误.错误发生在'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)

感谢您的任何帮助!

c struct typedef

-1
推荐指数
1
解决办法
590
查看次数

标签 统计

c ×1

struct ×1

typedef ×1