| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 495 人关注过本帖
标题:程序未响应!!求修改!!
取消只看楼主 加入收藏
You0
Rank: 2
等 级:论坛游民
帖 子:29
专家分:63
注 册:2014-8-2
结帖率:87.5%
收藏
已结贴  问题点数:10 回复次数:1 
程序未响应!!求修改!!
#define NULL 0
#include<stdio.h>

void get(int x);
struct list{
        char a;
        struct list *Next;
    };
   
int main(void)

{
   
    int b,c,d;
    printf("请问要输入几个字母:");
    scanf("%d",&b);
    get(b);
   
}

void get(int x)
{   
   
    int first,y;
    struct list *new1,*head=NULL,*current;
   
    for(first=1;first<=x;first++)
    {
        if(new1 = (struct list*)malloc(sizeof(struct list))==NULL)
        printf("ERROR!");
        
        
        
        printf("第%d个字母\n",first);
        scanf("%c",&head->a);
        new1->Next = head;
        head=new1;
        
   
   
    }
}
搜索更多相关主题的帖子: current include 字母 
2014-09-18 13:02
You0
Rank: 2
等 级:论坛游民
帖 子:29
专家分:63
注 册:2014-8-2
收藏
得分:0 
回复 2 楼 rjsp
已经解决了。head指向的是head  而且 ==的优先级大于= 、、、
2014-09-18 14:44
快速回复:程序未响应!!求修改!!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012376 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved