-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (28 loc) · 816 Bytes
/
main.cpp
File metadata and controls
36 lines (28 loc) · 816 Bytes
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
31
32
33
34
35
36
#include <stdio.h>
#include "coll/earray.h"
EARRAY_DECLARE(AInt, int)
EARRAY_DEFINE(AInt, int)
int main() {
AInt o;
char buffer[32];
AInt_open(&o, buffer, 32 / sizeof(int));
printf("AInt_open(&o, buffer, 32 / sizeof(int)).\n");
printf("o.space: %d.\n", o.space);
o.at[o.space - 1] = 0x0BADB055;
printf("o.at[o.space - 1]: %x.\n", o.at[o.space - 1]);
AInt_openHeap(&o, 64);
printf("AInt_openHeap(&o, 64).\n");
printf("o.space: %d.\n", o.space);
o.at[o.space - 1] = 0x600DB055;
printf("o.at[o.space - 1]: %x.\n", o.at[o.space - 1]);
AInt_close(&o);
printf("AInt_close(&o).\n");
AInt_openHeap(&o, 128);
printf("AInt_openHeap(&o, 128).\n");
AInt_reopen(&o, 256);
printf("AInt_reopen(&o, 256).\n");
printf("o.space: %d.\n", o.space);
AInt_close(&o);
printf("AInt_close(&o).\n");
return 0;
}