This is a slightly revamped version of a program some you guys helped me with last night. It turns out that it didn't meet the requirements, but this should if I can get it to work:
Code:
#include <stdio.h>
typedef enum {now=10, next, last} grade;
union {int age; float exactage;} age;
main()
{
struct {char first_name[20]; char last_name[20];} info;
int grade = now;
union age my;
my.exactage=15.731506849;
strcpy(info.first_name, "name");
strcpy(info.last_name, "name");
printf("This program is by %s %s. His exact age is %f, his approximate age is %d. He is currently is grade %d.", info.first_name, info.last_name, my.exactage, my.age, now);
}
error: "aggregate 'union age my' has incomplete type and cannot be initialized"
I've always had problems with unions, so odds are I've made at least one huge mistake. Any and all help would be appreciated.