As asked on my assignment earlier I had to just right two functions part (a) was regarding "enum" and part b was regarding "struct"
Now its asking me to create a union that can store either a. The enum in part(a) b. The struct in part(b) c. A single character.
i'm very confused.. What is this "either"?
Here I'm mentioning the code of part (a) & part (b)
a)
enum FavouriteFruits
{
Cherries=4,
Pears = 1,
Berries = 2,
Plums = 5
};
int main (int argc, char* argv[])
{
printf("Cherries are %d \n", Cherries);
printf("Pears are %d \n" , Pears);
printf("Berries are %d \n", Berries);
printf("Plums are %d \n", Plums);
return 0;
}
b)
struct realnumber
{
float array [2][3];
char* (*function)(int);
};