From 3122fe9d50ff1d86842375b267c9089956933f49 Mon Sep 17 00:00:00 2001 From: dvorakmortonxd Date: Thu, 21 May 2026 23:21:31 +0200 Subject: [PATCH] Structures --- main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/main.c b/main.c index ae991d6..55370b8 100644 --- a/main.c +++ b/main.c @@ -2,6 +2,14 @@ #include #include +// STRUCTURE TEST +struct man { + char firstname[20]; + char surname[20]; + int age; + int weight; + char relationship_status[10]; +}; int multiply(int num_one, int num_two) { int result = num_one*num_two; @@ -93,6 +101,11 @@ int main() { char message[22]="Hello, world. Again..."; printf("%s", message); + // STRUCTURES + printf("\n\nSTRUCTURE (peter) 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); + // END return 0; } \ No newline at end of file