一段小程序,出错了,各位帮帮忙

tracyjk tracyjk 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <memory.h>
#include <unistd.h>
#include <ctype.h>
#include <pwd.h>
#include <fcntl.h>
#include <termios.h>
#include <errno.h>

#include <sys/types.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/ioctl.h>


typedef struct _IRDA_ELECT
{
char total[10];
char high[10];
char low[10];
}IRDA_ELECT;
typedef struct IRDA_ELECT * PIRDA_ELECT;


typedef struct _USRINFO
{
char prc_code[10];
char mr_sn[5 + 1];
}USRINFO;
typedef struct USRINFO * PUSRINFO;


typedef struct _FOUINFO
{
USRINFO usrinfo;
char a[2];
}FOUINFO;
typedef struct FOUINFO * PFOUINFO;



int price_cacl(IRDA_ELECT Irda_elect,PFOUINFO pFouinfo)
{
float flat;
flat = atof(Irda_elect.total)-atof(Irda_elect.high)-atof(Irda_elect.low);
printf("T is %s--H is %s--L is %s--F is %f\n",Irda_elect.total,Irda_elect.high,Irda_elect.low,flat);

printf("prc_code is %s\n",pFouinfo->usrinfo.prc_code);
}

main()
{
IRDA_ELECT Irda_elect;
FOUINFO Fouinfo;
memset(&Irda_elect,0x00,sizeof(IRDA_ELECT));
memset(&Fouinfo,0x00,sizeof(FOUINFO));

sprintf(Irda_elect.total,"%s","80");
sprintf(Irda_elect.high,"%s","20");
sprintf(Irda_elect.low,"%s","20");
sprintf(Fouinfo.usrinfo.prc_code,"%s","40101019");
price_cacl(Irda_elect,&Fouinfo);
}



出现如下错误:
price.c: In function `price_cacl':
price.c:65: error: dereferencing pointer to incomplete type
price.c: In function `main':
price.c:79: warning: passing arg 2 of `price_cacl' from incompatible pointer type
查了下说是结构体的问题,但是找不到原因...
...全文

相关推荐

评论 7
收藏 已收藏
分享
返回顶部
tracyjk
C语言 70,039 成员 243,237 内容