当前位置: 代码迷 >> C语言 >> 各位麻烦啦!
  详细解决方案

各位麻烦啦!

热度:246   发布时间:2008-05-21 17:34:00.0
各位麻烦啦!
1. 函数的原型说明为int chrsn(char *s,char *t);,其功能是测试t在s中出现的次数,编制该函数并用相应的主函数对其进行测试。
2. 函数的原型说明为int mychrcmp(char *s,char *t);,其功能是判定s与t的关系,函数返回值大于0时表示s大于t;函数返回值小于0时表示s小于t;函数返回值等于0时表示s等 于t。编制该函数并用相应的主函数对其进行测试。
3. 以下函数creatlist用来建立一个带头节点的单项链表,新产生的节点总是插在链表的末尾。单项链表的头指针作为函数值返回。函数中以换行符作为链表建立的结束标志。请填空。   
    #include<stdio.h>
    struct node
    {   char data;
        struct node *next;  };
    struct node* creatlist()
    { struct list *h,*p,*q;
      char ch;
      h=(struct node*)malloc(sizeof(struct node));  
      p=q=h;
      ch=getchar();
     while(       ①        )
      {  p=(struct node*)malloc(sizeof(struct node));
         p->data=ch;
         q->next=p;
         q=p;
         ch=getchar();  }
      p->next='\0';            
      return h;}
搜索更多相关的解决方案: 函数  char  链表  返回值  麻烦  

----------------解决方案--------------------------------------------------------
p->data!=0作业????
----------------解决方案--------------------------------------------------------
不会写
才最近学到
----------------解决方案--------------------------------------------------------
  相关解决方案