C语言错误 left of '.name' must have struct/union type
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/10/01 19:25:27
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
#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
SongInfo 必须是一个已经定义的结构体,才能用 SongInfo[ n ].name 语句成立
错误信息提示你 SongInfo 不是一个结构体或者联合体
再问: 头文件里定义过了
再答: 然后你又定义了一个 char * SongInfo 字符串变量 导致变量名重复,所以编译器报错
错误信息提示你 SongInfo 不是一个结构体或者联合体
再问: 头文件里定义过了
再答: 然后你又定义了一个 char * SongInfo 字符串变量 导致变量名重复,所以编译器报错
C语言错误 left of '.name' must have struct/union type
left of '._Myptr' must have class/struct/union type
c语言错误:'FILE' :illegal use of this type as an expression这是神马情
问一个C语言里面的错误啊,argument of type "float" is incompatible with p
c语言 union 意思?
一个C语言找错题#includemain(){struct{long number;char name[10];char
问一道C语言问题若已定义:struct studentint {int num;name[20];}stu1,stu2;
c# 语言中method must have a return type 如何解决
Hibernate配置文件错误提示,The content of element type "list" must ma
typedef union { long i;int k[5];char c; }DATE; struct date {
关于c语言,请问typedef struct {elemtype data ;struct Node *next ;}N
C语言:expression preceding parentheses of apparent call must h