reverse函数里 找 六个 error 标清行数

 

修改如下,供参考:

#include<stdlib.h>
#include<stdio.h>

struct  node_int;
typedef struct node_int *node;
struct node_int
{
      void *data;
      node next;
};

struct  stack_int;
typedef struct stack_int *stack;
struct stack_int
{
     node tos;
};

void reverse(stack *rsp,stack s)
{
    node sc;
    node c;
    (*rsp) = (stack)malloc(sizeof(struct stack_int));
    (*rsp)->tos = NULL;
    sc = s->tos;
    while(sc != NULL)
    {
        c = (node)malloc(sizeof(struct node_int));
        sc->data = c->data;
        c->next = (*rsp)->tos;
        (*rsp)->tos = c;
        sc = sc->next;
    }
}

 

这是考试吗?都明确有6个error了?

那结构体定义里,多了 int  ,struct node int 是什么意思

您好,我是有问必答小助手,您的问题已经有小伙伴解答了,您看下是否解决,可以追评进行沟通哦~

如果有您比较满意的答案 / 帮您提供解决思路的答案,可以点击【采纳】按钮,给回答的小伙伴一些鼓励哦~~

ps: 问答会员年卡【8折】购 ,限时加赠IT实体书,即可 享受50次 有问必答服务,了解详情>>>https://t.csdnimg.cn/RW5m