summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorJonas Kohl <gitlab@jonaskohl.de>2024-08-29 17:00:11 +0200
committerJonas Kohl <gitlab@jonaskohl.de>2024-08-29 17:00:11 +0200
commit84ad096896e9948c722a957d07ed6868e252a9f7 (patch)
treeb8ad1afadd89f1dc7599436cfb0f7f5fb0c177b6 /main.c
Initial commit
Diffstat (limited to 'main.c')
-rw-r--r--main.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/main.c b/main.c
new file mode 100644
index 0000000..535a0b4
--- /dev/null
+++ b/main.c
@@ -0,0 +1,30 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include "includes/point.h"
+#include "includes/rect.h"
+
+int main(int argc, char** argv) {
+ Point point = Point_alloc();
+ Point_init(point, 0, 0);
+ Rect rect = Rect_alloc();
+ Rect_init(rect, 4, 5, 120, 90);
+
+ char buffer [64];
+
+ Rect_toString(rect, buffer);
+ printf("Rect: %s\n", buffer);
+ printf(" right = %i, bottom = %i\n", Rect_right_get(rect), Rect_bottom_get(rect));
+
+ Point_toString(point, buffer);
+ printf("Point (1): %s\n", buffer);
+
+ Point_init(point, 25, -3.5f);
+
+ Point_toString(point, buffer);
+ printf("Point (2): %s\n", buffer);
+
+ free(point);
+ free(rect);
+
+ return 0;
+}