首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

很久都不能解决的结构体有关问题

2012-04-26 
很久都不能解决的结构体问题data.hC/C++ codetypedef struct{int use_allint use_way//1.活动娱乐消费;2

很久都不能解决的结构体问题
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;

热点排行