| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 868 人关注过本帖
标题:如何解决 error C3861
只看楼主 加入收藏
站在4楼
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2013-10-24
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:3 
如何解决 error C3861
数据结构,程序提示找不到标识符。
程序代码:
#include <stdio.h>
#include"stdlib.h"
#include"string.h"
typedef struct flower
{char name[10];
char addr[10];
char color[10];
float price;
int amount;
char time[10];
char dtime[10];
struct flower *link;}lnode,*lnodelist;
void creat(lnodelist &head)
{int n=5;lnodelist p;
head=(lnode*)malloc(sizeof(lnode));
head->link=NULL;
p=head->link;
while(!n)
{
    p=(lnode*)malloc(sizeof(lnode));
printf("pleease input name,address,color,price,amount,time and expiration");
    scanf("%s%s%s%f%d%s%s",&(p->name),&(p->addr),&(p->color),&(p->price),&(p->amount),&(p->time),&(p->dtime));
p->link=head->link;head->link=p;
--n;
}
}//建立链表
lnodelist print(lnodelist head)
{
    lnodelist p;
    if(head==NULL)printf("error!");
    p=head;
while(!p)
{
printf("%s%s%s%f%d%s%s\n",p->name,p->addr,p->color,p->price,p->amount,p->time,p->dtime);
p=p->link;
}
return(head);
}//输出链表
lnodelist cx(lnodelist head)
{
    int n;
    printf("there are 7 choices./n1 stands for name;2 stands for addr;/n3 stands for color;4 stands for price;/n");
    printf("5 stands for amount.6 stands for time;/n7 stands for dtime.please input one number./n");
    scanf("%d",&n);
    switch(n)
    {case'1':cxname(head);break;
    case'2':cxaddr(head);break;
    case'3':cxcolor(head);break;
    case'4':cxprice(head);break;
    case'5':cxamount(head);break;
    case'6':cxtime(head);break;
    case'7':cxdtime(head);break;
    default: printf("error");
    }
    return(head);
}
lnodelist sc(lnodelist head)
{
    int n;
    printf("there are 7 choices./n1 stands for name;2 stands for addr;/n3 stands for color;4 stands for price;/n");
    printf("5 stands for amount.6 stands for time;/n7 stands for dtime.please input one number./n");
    scanf("%d",&n);
    switch(n)
    {case'1':scname(head);break;
    case'2':scaddr(head);break;
    case'3':sccolor(head);break;
    case'4':scprice(head);break;
    case'5':scamount(head);break;
    case'6':sctime(head);break;
    case'7':scdtime(head);break;
    default: printf("error");
    }
    return(head);
}
lnodelist cxname(lnodelist head)
{
    char n[10];lnodelist p;
    if(head==NULL)printf("error");
    p=head;
printf("input the flower's name/n");
gets(n);
while(!p)
{
if(strcmp(p->name,n)==0)printf("%s%s%s%f%d%s%s\n",p->name,p->addr,p->color,p->price,p->amount,p->time,p->dtime);
p=p->link;
}
return(head);
}
lnodelist cxaddr(lnodelist head)
{
    char n[10];lnodelist p;
    if(head==NULL)printf("error");
    p=head;
printf("input the flower's address/n");
gets(n);
while(!p)
{
if(strcmp(p->addr,n)==0)printf("%s%s%s%f%d%s%s\n",p->name,p->addr,p->color,p->price,p->amount,p->time,p->dtime);
p=p->link;
}
return(head);
}
lnodelist cxcolor(lnodelist head)
{
    char n[10];lnodelist p;
    if(head==NULL)printf("error");
    p=head;
printf("input the flower's color/n");
gets(n);
while(!p)
{
if(strcmp(p->color,n)==0)printf("%s%s%s%f%d%s%s\n",p->name,p->addr,p->color,p->price,p->amount,p->time,p->dtime);
p=p->link;
}
return(head);
}
lnodelist cxtime(lnodelist head)
{
    char n[10];lnodelist p;
    if(head==NULL)printf("error");
    p=head;
printf("input the flower's time/n");
gets(n);
while(!p)
{
if(strcmp(p->time,n)==0)printf("%s%s%s%f%d%s%s\n",p->name,p->addr,p->color,p->price,p->amount,p->time,p->dtime);
p=p->link;
}
return(head);
}
lnodelist cxdtime(lnodelist head)
{
    char n[10];lnodelist p;
    if(head==NULL)printf("error");
    p=head;
printf("input the flower's dtime/n");
gets(n);
while(!p)
{
if(strcmp(p->dtime,n)==0)printf("%s%s%s%f%d%s%s\n",p->name,p->addr,p->color,p->price,p->amount,p->time,p->dtime);
p=p->link;
}
return(head);
}
lnodelist cxprice(lnodelist head)
{
float n;lnodelist p;
if(head==NULL)printf("error");
    p=head;
printf("input the flower's price");
scanf("%f",&n);
while(!p)
{
if(n==p->price)printf("%s%s%s%f%d%s%s\n",p->name,p->addr,p->color,p->price,p->amount,p->time,p->dtime);
p=p->link;
}
return(head);
}
lnodelist cxamount(lnodelist head)
{
int n;lnodelist p;
if(head==NULL)printf("error");
    p=head;
printf("input the flower's amount");
scanf("%d",&n);
while(!p)
{
if(n==p->amount)printf("%s%s%s%f%d%s%s\n",p->name,p->addr,p->color,p->price,p->amount,p->time,p->dtime);
p=p->link;
}
return(head);
}
lnodelist scname(lnodelist head)
{
    char n[10];lnodelist p,q;
    if(head==NULL)printf("error");
    p=head;
printf("input the flower's name/n");
gets(n);
while(!p)
{
if(strcmp(p->name,n)==0)q=p->link;p->link=p->link->link;free(q);
}
return(head);
}
lnodelist scaddr(lnodelist head)
{
    char n[10];lnodelist p,q;
    if(head==NULL)printf("error");
    p=head;
printf("input the flower's address/n");
gets(n);
while(!p)
{
if(strcmp(p->addr,n)==0)q=p->link;p->link=p->link->link;free(q);
}
return(head);
}
lnodelist sccolor(lnodelist head)
{
    char n[10];lnodelist p,q;
    if(head==NULL)printf("error");
    p=head;
printf("input the flower's color/n");
gets(n);
while(!p)
{
if(strcmp(p->color,n)==0)q=p->link;p->link=p->link->link;free(q);
}
return(head);
}
lnodelist sctime(lnodelist head)
{
    char n[10];lnodelist p,q;
    if(head==NULL)printf("error");
    p=head;
printf("input the flower's time/n");
gets(n);
while(!p)
{
if(strcmp(p->time,n)==0)q=p->link;p->link=p->link->link;free(q);
}
return(head);
}
lnodelist scdtime(lnodelist head)
{
    char n[10];lnodelist p,q;
    if(head==NULL)printf("error");
    p=head;
printf("input the flower's dtime/n");
gets(n);
while(!p)
{
if(strcmp(p->dtime,n)==0)q=p->link;p->link=p->link->link;free(q);
}
return(head);
}
lnodelist scprice(lnodelist head)
{
float n;lnodelist p,q;
if(head==NULL)printf("error");
    p=head;
printf("input the flower's price");
scanf("%f",&n);
while(!p)
{
if(n==p->price)q=p->link;p->link=p->link->link;free(q);
}
return(head);
}
lnodelist scamount(lnodelist head)
{
int n;lnodelist p,q;
if(head==NULL)printf("error");
    p=head;
printf("input the flower's amount");
scanf("%d",&n);
while(!p)
{
if(n==p->amount)q=p->link;p->link=p->link->link;free(q);
}
return(head);
}
void main()
{char f;int n=1;
lnodelist head;head=NULL;
printf("welcome to flower store information system\n");
printf("there are 4 functions:\n");
printf("zhuijia is A\nxiugai is B\nshanchu is C\nchaxun is D\n");
printf("please select a function:");
scanf("%c",&f);
switch(f)
{case 'A': if(n==1)

             {creat(head); break;}

          /*else

             {zj();break;}/*追加功能函数*/
/*case 'B':xg();break; /*修改功能函数*/
case 'C':sc(head);break; /*删除功能函数*/
case 'D':cx(head);break; /*查询功能函数*/
default:printf("there is an error!");/*输入命令错误*/
}
}
搜索更多相关主题的帖子: color 如何 
2013-10-24 21:32
wp231957
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:神界
等 级:贵宾
威 望:423
帖 子:13688
专家分:53332
注 册:2012-10-18
收藏
得分:7 
好长啊   为什么没有把错误信息帖出来呢

DO IT YOURSELF !
2013-10-24 21:41
站在4楼
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2013-10-24
收藏
得分:0 
已解决,谢谢
2013-10-25 16:49
f201225010
Rank: 1
等 级:新手上路
帖 子:1
专家分:7
注 册:2013-10-25
收藏
得分:7 
傻逼
2013-10-25 16:57
快速回复:如何解决 error C3861
数据加载中...
 
   



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

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