很久都不能解决的结构体有关问题
很久都不能解决的结构体问题
data.h
编译的时候有两个错误,求解决
d:\课程设计\data.h(9) : see declaration of 'cashofdata'
d:\课程设计\data.h(14) : error C2061: syntax error : identifier 'cash'
d:\课程设计\data.h(15) : error C2059: syntax error : '}'
------解决方案--------------------
typedef struct
{
cashofdata all_about;
cash * next;
}cash,cash*;
------解决方案--------------------
typedef struct
{
int use_all;
int use_way;//1.活动娱乐消费;2.工具/书籍经费;3.临时消费;4.定期费用;
char use_who[40];
int inorout;//1为收入,0为支出
int year;
int month;
}cashofdata;
typedef struct cash
{
cashofdata all_about;
cash* next;
}cash;
data.h
- C/C++ code
typedef struct { int use_all; int use_way;//1.活动娱乐消费;2.工具/书籍经费;3.临时消费;4.定期费用; char use_who[40]; int inorout;//1为收入,0为支出 int year; int month; }cashofdata; typedef struct { cashofdata all_about; cash * next; }cash;
编译的时候有两个错误,求解决
d:\课程设计\data.h(9) : see declaration of 'cashofdata'
d:\课程设计\data.h(14) : error C2061: syntax error : identifier 'cash'
d:\课程设计\data.h(15) : error C2059: syntax error : '}'
------解决方案--------------------
typedef struct
{
cashofdata all_about;
cash * next;
}cash,cash*;
------解决方案--------------------
typedef struct
{
int use_all;
int use_way;//1.活动娱乐消费;2.工具/书籍经费;3.临时消费;4.定期费用;
char use_who[40];
int inorout;//1为收入,0为支出
int year;
int month;
}cashofdata;
typedef struct cash
{
cashofdata all_about;
cash* next;
}cash;