diff --git a/main.c b/main.c index 55370b8..b3618b2 100644 --- a/main.c +++ b/main.c @@ -11,6 +11,12 @@ struct man { char relationship_status[10]; }; +// UNION TEST +union woman { + int age; + int weight; +}; + int multiply(int num_one, int num_two) { int result = num_one*num_two; return result; @@ -102,10 +108,19 @@ int main() { printf("%s", message); // STRUCTURES - printf("\n\nSTRUCTURE (peter) BELOW:\n"); // DIVIDER + printf("\n\nSTRUCTURE (man) BELOW:\n"); // DIVIDER struct man PETER={"Peter", "Griffin", 35, 150, "married"}; printf("Our man is named %s %s, he is %d years old, he weights %dkg and his relationship status is %s.", PETER.firstname, PETER.surname, PETER.age, PETER.weight, PETER.relationship_status); + // UNIONS + printf("\n\nUNION (woman) BELOW:\n"); // DIVIDER + union woman LOIS; + LOIS.age = 34; + LOIS.weight = 60; + printf("Our woman is unknown, she is not %d years old and she weights %dkg. (LOIS.age and LOIS.weight).", LOIS.age, LOIS.weight); + // END return 0; + + // THIS IS THE CURRENT END OF MY LESSON } \ No newline at end of file