主观

设有下列创建单向链表的部分程序:

#include"malloc.h"

   #include"string.h"

   struct automobile

   {

char type[20];

int load;

struct automobile *next;

} * head=NULL;

  void main(void)

  {

struct automobile *p;

char * automobile_type[3]={"Red_Rock",Yellow_River","East_Wind"};

int automobile_load[3]={24,18,42},j;

for(j=0;j﹤3;j+ +)

{

      p=(①______________)malloc(sizeof(struct automobile));

      strcpy(②_____________,automobile_type[j]);

      p->load=automobile_load[j];

      p->next=head;

      head=p;

}

  }

请阅读分析程序,然后写出①和②下划线处应该填写的内容。

参考答案
您可能感兴趣的试题
¥

订单号:

遇到问题请联系在线客服

订单号:

遇到问题请联系在线客服