一段小程序,出错了,各位帮帮忙
#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
查了下说是结构体的问题,但是找不到原因...
...全文
相关推荐
微信小程序 合法域名校验出错详解及解决办法
微信小程序 合法域名校验出错详解及解决办法看下出现错误:微信小程序开发,遇到这个问题怎么办? 产生原因是因为发起了wx.request请求 而请求的域名没有在微信公众平台后台设置。1.开发者自己手动设
显示整数各位数字
在编程领域,有时我们需要将一个整数分解成其各位数字并分别显示出来。在这个场景下,C语言可以提供一种简洁而高效的方法来实现这个功能。本文将深入探讨如何使用C语言编写小程序,来显示整数的每一位数字。
代码_C循环-求各位数字之积_
循环是程序设计中的基础结构,它允许我们在满足特定条件时重复执行一段代码。在这个例子中,`while`循环用于不断处理输入数字的每一位。
编程实现输入一个整数,显示它的位数,并显示它的各位数字,及其各位数字的和
显示各位数字:遍历整数的每一位,可以用循环来实现。
仿师兄帮帮忙
【标题】"仿师兄帮帮忙"是一个基于.NET技术构建的网页应用项目,旨在模仿已有的“师兄帮帮忙”服务。这个项目采用了三层架构设计,即表现层、业务逻辑层和数据访问层,以实现良好的代码组织和模块化。


