小编use*_*962的帖子

为什么这会产生一个整数的指针?

 push(equation, pop(equation) + pop(equation));
Run Code Online (Sandbox Code Playgroud)

这是我正在使用的流行音乐

int pop(struct stack *st)
{
   int c;
   if (st->top == -1)
   {
      printf("Stack is empty");
      return NULL;
   }
   c = st->arr[st->top];
   st->top--;
   return c;
}
Run Code Online (Sandbox Code Playgroud)

这是推动

void push(struct stack *st, int * c)
{
   if (st->top == 99)
   {
      printf("Stack is full");
      return ;
   }
        printf("TOP = %d\n", st->top);
   st->top++;
        printf("TOP = %d\n", st->top);
   st->arr[st->top] = c;
}
Run Code Online (Sandbox Code Playgroud)

它说push的第二个arg是从一个没有强制转换的整数制作一个指针,但我不明白为什么如果有人能解释它我会很感激.

c

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

标签 统计

c ×1