Asambojur 2015-06-02 08:42 采纳率: 0%
浏览 1561

这段代码的问题请大神们告诉我一下吧~··· debug提示的问题我没懂。。。

#include
#include

struct student {
char name;
int age;
int no;
struct student *next;
};

main() {
struct student create(void) {
struct student *p1,*p2,*head;
head = NULL;
p1 = p2 = (struct student
)malloc(sizeof(struct student));
scanf("%c,%d,%d",p1->name,p1->age,p1->no);
while (p1->no != 0) {
if (p1->no == 1)
head = p1;
else
p2->next = p1;
p2 = p1;
p1 = (struct student*)malloc(sizeof(struct student));
scanf("%c,%d,%d",p1->name,p1->age,p1->no);
}
p2->next = NULL;
return head;
}
}

  • 写回答

7条回答

  • 逆-风 2015-06-02 09:02
    关注

    要把debug那些提示也应该传上来

    评论

报告相同问题?

悬赏问题

  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题