码迷,mamicode.com
首页 > 其他好文 > 详细

C和指针 (pointers on C)——第十章:结构体和联合(下)习题

时间:2014-07-21 23:16:53      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:c   指针   struct   结构   

//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;
	};
	
};

C和指针 (pointers on C)——第十章:结构体和联合(下)习题

标签:c   指针   struct   结构   

原文地址:http://blog.csdn.net/liyakun1990/article/details/38025471

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!