diff --git a/basic/6_struct.c b/basic/6_struct.c new file mode 100644 index 0000000..43785e7 --- /dev/null +++ b/basic/6_struct.c @@ -0,0 +1,17 @@ +#include + +struct Person +{ + char name[50]; + int age; + float height; +}; + +int main() +{ + struct Person person = { "Alice", 30, 170.5 }; + + printf("Name: %s\n", person.name); + printf("Age: %d\n", person.age); + printf("Height: %.2f\n", person.height); +}