1 | #include <stdint.h> |
2 | |
3 | struct foo |
4 | { |
5 | uint32_t a; |
6 | uint32_t b; |
7 | float c; |
8 | foo() : a(0), b(1), c(3.14) {} |
9 | foo(uint32_t A, uint32_t B, float C) : |
10 | a(A), |
11 | b(B), |
12 | c(C) |
13 | {} |
14 | }; |
15 | |
16 | int main (int argc, char const *argv[]) |
17 | { |
18 | foo* foobar = new foo[2]; |
19 | |
20 | foobar[0].a = 1; |
21 | foobar[0].b = 9; |
22 | |
23 | foobar[1].a = 8; |
24 | foobar[1].b = 5; |
25 | |
26 | foobar[1].b = 7; // set breakpoint here |
27 | |
28 | foobar[1].c = 6.28; |
29 | |
30 | foo barfoo[] = {foo(1,2,3), foo(4,5,6)}; |
31 | |
32 | delete[] foobar; |
33 | |
34 | return 0; |
35 | } |
36 | |