C和指針 (pointers on C)——第十章:結構體和聯合(下)習題
//1、這一章的習題純粹為了刷存在感。。。
typedef struct phone
{
char * quhao;
char * jiaohuantai;
char * zhanhaoma;
};
typedef struct call
{
char * date;
char * time;
phone * shiyong;
phone * self;
phone * hujiao;
};
2、
typedef struct cash
{
float retail_price;
float actual_price;
float sales_tax;
float licensing_fee;
};
typedef struct daikuan
{
float retail_price;
float actual_price;
float sales_tax;
float licensing_fee;
float doun_payment;
float loan_duration;
float interst_rate;
float monthly_payment;
float name_of_bank;
};
typedef struct zulin
{
float retail_price;
float actual_price;
float down_payment;
float security_deposit;
float monthly_payment;
int lease_term;
};
typedef struct sale
{
char name[20];
char address[40];
char model[20];
union
{
cash trade;
daikuan trade;
zulin trade;
};
};