[Tutor] Array of structures

Glen Barnett glenbar@gte.net
Tue, 22 May 2001 17:50:43 -0700


Is there an equivalent Python script for the C  language array of
structures? An example C program is:

struct day
{
	char month[3];
	int day;
	int year;
};
void PrintIt( struct day bd );

void main(void)
{
	struct day Birthday[15];

	Birthday[2].month[0]=3D=92J=92;
	Birthday[2].month[1]=3D=92a=92;
	Birthday[2].month[2]=3D=92n=92;
	Birthday[2].day=3D21;
	Birthday[2].year=3D1970;

	PrintIt(Birthday[2]);

}
void PrintIt( struct day bd )
{
	printf (=93\nMonth %c%c%c  =94, bd.month[0], bd.month[1] bd.month[2]);
	printf (=93Day %d  =94, bd.day );
	printf (=93Year %d=94, bd.year);
}

Thanks

Glen Barnett