标签: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); }
标签:color io ar amp size har height print
原文地址:http://blog.csdn.net/u013116579/article/details/38453099