diff options
author | Jonas Kohl <gitlab@jonaskohl.de> | 2024-08-29 17:00:11 +0200 |
---|---|---|
committer | Jonas Kohl <gitlab@jonaskohl.de> | 2024-08-29 17:00:11 +0200 |
commit | 84ad096896e9948c722a957d07ed6868e252a9f7 (patch) | |
tree | b8ad1afadd89f1dc7599436cfb0f7f5fb0c177b6 /main.c |
Initial commit
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -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; +} |