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

P162

时间:2014-08-09 11:49:17      阅读:277      评论:0      收藏:0      [点我收藏+]

标签:color   io   ar   amp   size   har   height   print   

#include<string.h>
#include<stdio.h>
main()
{
	struct objects{
		char name[20];
		int size;
		char color[10];
		float weight;
		float height;
		};
		struct objects obj1;
		struct objects *p;
		p=&obj1;
		strcpy(obj1.name,"pen");
		obj1.size=10;
		strcpy(obj1.color,"black");
		obj1.weight=50.5;
		obj1.height=18.5;
		printf("name:%s\nsize:%d\ncolor:%s\nweight:%f\nheight:%f\n",obj1.name,obj1.size,obj1.color,obj1.weight,obj1.height);
		printf("name:%s\nsize:%d\ncolor:%s\nweight:%f\nheight:%f\n",(*p).name,(*p).size,(*p).color,(*p).weight,(*p).height);
	
}

P162,布布扣,bubuko.com

P162

标签:color   io   ar   amp   size   har   height   print   

原文地址:http://blog.csdn.net/u013116579/article/details/38453099

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