| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 620 人关注过本帖
标题:编译时出现的一个错误,请教一下
只看楼主 加入收藏
hrtncwu
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2005-9-29
收藏
 问题点数:0 回复次数:2 
编译时出现的一个错误,请教一下
用c编的程序,编译的时候出现了三个提示一样的错误,lvalue required in function main 什么意思,估计应该在哪里修改,请各位高手指教,谢谢了
搜索更多相关主题的帖子: 编译 lvalue function main 
2005-09-29 17:48
本人已死
Rank: 1
等 级:新手上路
威 望:1
帖 子:183
专家分:0
注 册:2005-9-20
收藏
得分:0 
嗯把代码发出来看下撒,这样哪知道错在哪儿啊?

爸爸告诉我:女人喜欢有钱的男人;妈妈告诉我:女人喜欢有貌的男人。我翻翻钱包,又照照镜子,然后我哭了
2005-09-29 17:51
hrtncwu
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2005-9-29
收藏
得分:0 
用*标记的句子就是报错的地方,三次报错一样
main()
{struct car{
   int inf;
   int num;
   int time;
   struct car *next;
  };
 int m,n=0,j=0,time1;
 int max=3;
 struct car *p1,*p2;
 struct car *front,*rear;
 struct car *top1,*base1;
 struct car *top2,*base2;
 p1=(struct car*)malloc(sizeof(struct car));
 top1=base1=(struct car*)malloc(3*sizeof(struct car));
 top2=base2=(struct car*)malloc(sizeof(struct car));
 front=rear=(struct car*)malloc(sizeof(struct car));
 printf("input the information of this car:");
 scanf("%d",&p1->inf);
 printf("input the number of this car:");
 scanf("%d",&p1->num);
 printf("input the time of this car:");
 scanf("%d",&p1->time);
 while(p1->inf!=00)
   {while(p1->inf==01)
       {if(top1-base1<(max*sizeof(struct car)))
           { ****top1++=p1;****
             n++;
             printf("the car stopped at the %dth of the stack",n);
           }
          else
             {rear->next=p1;
              rear=p1;
              j++;
              printf("the car stopped at the %dth of the quene",j);
             }
         p1=(struct car*)malloc(sizeof(struct car));
         printf("input the information of this car:");
         scanf("%d%d%d",&p1->inf,&p1->num,&p1->time);
       }
    while(p1->inf==10)
        {while(p1->num!=(--top1)->num)
           {
           **** top2++=(--top1);*****
            time1=p1->time-(--top1->time);
            printf("the car has stopped %d minuters\n",time1);
            printf("you should pay for %d*x yuan\n",time1);
           }
         while(top2!=base2)
            top1++==(--top2);
         while(front!=rear)
            { p2=front->next;
              front->next=p2->next;
              p2->time=p1->time;
             ***** top1++=p2;*******
              if(rear==p2)
                rear=front;
              p1=(struct car*)malloc(sizeof(struct car));
              printf("input the information of this car:");
              scanf("%d%d%d",&p1->inf,&p1->num,&p1->time);
         }
     if(p1->inf==0)
      break;
    }
   printf("thank you for using this system\n");
  }
}的
2005-09-29 17:56
快速回复:编译时出现的一个错误,请教一下
数据加载中...
 
   



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

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