summaryrefslogtreecommitdiff
path: root/main.c
blob: 535a0b45c71d7a4bcd24851abc645270156b7d78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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;
}