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/11/28 21:52:30
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 不是一个结构体或者联合体