| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2344 人关注过本帖
标题:NSB600"CL.EXE"已退出,代码为2
取消只看楼主 加入收藏
兔先生
Rank: 2
等 级:论坛游民
帖 子:41
专家分:20
注 册:2018-11-9
结帖率:63.64%
收藏
已结贴  问题点数:10 回复次数:1 
NSB600"CL.EXE"已退出,代码为2
代码如下,是有关链表逆置的。
程序代码:
#include<stdio.h>
#include<stdlib.h>

struct node
{
    int data;
    struct node* next;
    struct node* prior;
};
void initlist(node* p);
void conversion(node* q);
void Printf(node* q);
int main()
{
     node* p;
    p = (struct  node*)malloc(sizeof(node));
    p->next = NULL;
    p->prior = NULL;
    p->data = -1;
    initlist(p);
    conversion(p);
    //Printf(p);
}
void initlist(node* q)
{
    int i;
    struct node* k,*p;
    p->data = 0;
    k= q->next;
    while (i<10)
    {
        struct node*s= (struct  node*)malloc(sizeof(node));
        s->data = p->data ++;
        s->prior = k;
        k->next = s;
        k = k->next;
        s->next = NULL;
    }
}
void conversion(node* q)
{
    int i;
    struct node* p,*s;
    s = q->next;
    while (s->data !=NULL)
    {
        if (s->next == NULL)
            p = s;
        s = s->next;
    }
    s = q->next;
    while (&s !=& p || s->prior != p)
    {
        s->data = s->data + p->data;
        p->data = s->data - p->data;
        s->data = s->data - p->data;
        p = p->prior;
        s = s->next;
    }
}

void Printf(node* q)
{
    struct node* p;
    p = q->next;
    while (p->next == NULL)
    {
        printf("%d", p->data);
        p = p->next;
    }
}

双击错误则转到另一个页面显示代码如下;

         <!-- Rest of the sources -->
429->    <CL Condition="'%(ClCompile.PrecompiledHeader)' != 'Create' and '%(ClCompile.ExcludedFromBuild)'!='true' and '%()' == '' and @(ClCompile) != ''"
         BuildingInIDE                      ="$(BuildingInsideVisualStudio)"
         Sources                            ="@(ClComp
有没有大佬知道这是哪方面的错误??
搜索更多相关主题的帖子: void struct next node data 
2019-09-30 15:37
兔先生
Rank: 2
等 级:论坛游民
帖 子:41
专家分:20
注 册:2018-11-9
收藏
得分:0 
回复 2楼 rjsp
像这种双向链表逆置采用两头交换值并向中间移动的方法可以实现吗?;
判断已经交换完全的条件是什么?;
2019-09-30 18:54
快速回复:NSB600"CL.EXE"已退出,代码为2
数据加载中...
 
   



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

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