C语言错误 left of '.name' must have struct/union type#include#include#include#include"me.h"void pr_4(){\x05int a=0;char ch;int n=0;\x05char *numstr;\x05char *SongInfo;if((fp=fopen("SongInfo.dat","rb"))==NULL)\x05{\x05printf("\ncannot open file \n
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/30 05:54:15
![C语言错误 left of '.name' must have struct/union type#include#include#include#include](/uploads/image/z/12721658-50-8.jpg?t=C%E8%AF%AD%E8%A8%80%E9%94%99%E8%AF%AF+left+of+%27.name%27+must+have+struct%2Funion+type%23include%23include%23include%23include%22me.h%22void+pr_4%28%29%7B%5Cx05int+a%3D0%3Bchar+ch%3Bint+n%3D0%3B%5Cx05char+%2Anumstr%3B%5Cx05char+%2ASongInfo%3Bif%28%28fp%3Dfopen%28%22SongInfo.dat%22%2C%22rb%22%29%29%3D%3DNULL%29%5Cx05%7B%5Cx05printf%28%22%5Cncannot+open+file+%5Cn)
C语言错误 left of '.name' must have struct/union type#include#include#include#include"me.h"void pr_4(){\x05int a=0;char ch;int n=0;\x05char *numstr;\x05char *SongInfo;if((fp=fopen("SongInfo.dat","rb"))==NULL)\x05{\x05printf("\ncannot open file \n
C语言错误 left of '.name' must have struct/union type
#include
#include
#include
#include"me.h"
void pr_4()
{
\x05int a=0;char ch;int n=0;
\x05char *numstr;
\x05char *SongInfo;
if((fp=fopen("SongInfo.dat","rb"))==NULL)
\x05{
\x05printf("\ncannot open file \n");
\x05exit(0);
\x05}
\x05while(fread(&SI,sizeof (struct SongInfo),1,fp)==1)
\x05\x05n++;
\x05 a=n;
\x05\x05printf("请输入查询方式\n");
\x05\x05printf("1 歌曲名称 2 歌曲作者 3 歌曲演唱者\n");
ch=getchar();getchar();
\x05\x05switch(ch)
\x05\x05{
\x05\x05case 1:
\x05\x05\x05\x05 printf("请输入要查找歌曲名称:\n");
\x05\x05\x05\x05 gets(numstr);
\x05\x05\x05\x05 for(n=0;n
C语言错误 left of '.name' must have struct/union type#include#include#include#include"me.h"void pr_4(){\x05int a=0;char ch;int n=0;\x05char *numstr;\x05char *SongInfo;if((fp=fopen("SongInfo.dat","rb"))==NULL)\x05{\x05printf("\ncannot open file \n
SongInfo 必须是一个已经定义的结构体,才能用 SongInfo[ n ].name 语句成立
错误信息提示你 SongInfo 不是一个结构体或者联合体