aboutsummaryrefslogtreecommitdiff
path: root/v1/main.c
diff options
context:
space:
mode:
authorSopár Adrián <dev.adrian.sopar@protonmail.com>2023-01-27 00:05:24 +0100
committerSopár Adrián <dev.adrian.sopar@protonmail.com>2023-01-27 00:05:24 +0100
commit2c5a5f7679a5f450e483fdedc99c80622f260a4d (patch)
treec96f4f9020275e8853c92f008fa9f041e0529a57 /v1/main.c
Init commit.HEADmaster
Diffstat (limited to 'v1/main.c')
-rw-r--r--v1/main.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/v1/main.c b/v1/main.c
new file mode 100644
index 0000000..d149c87
--- /dev/null
+++ b/v1/main.c
@@ -0,0 +1,22 @@
+#include <stdio.h>
+#include "square.h"
+
+void print_square(struct square *square)
+{
+ double area = square_area(square);
+ printf("square_area=%f\n", area);
+}
+
+void print_shape(struct shape *shape)
+{
+ double area = shape_area(shape);
+ printf("shape_area=%f\n", area);
+}
+
+int main(int argc, char **argv)
+{
+ struct square *square = square_create(5);
+ print_square(square);
+ print_shape(square_as_shape(square));
+ shape_destroy(square_as_shape(square));
+}