1 | |
2 | #define BUFFER_SIZE 16 |
3 | struct PointType { |
4 | int x; |
5 | int y; |
6 | int buffer[BUFFER_SIZE]; |
7 | }; |
8 | #include <vector> |
9 | int g_global = 123; |
10 | static int s_global = 234; |
11 | int test_indexedVariables(); |
12 | int main(int argc, char const *argv[]) { |
13 | static float s_local = 2.25; |
14 | PointType pt = {.x: 11, .y: 22, .buffer: {0}}; |
15 | for (int i = 0; i < BUFFER_SIZE; ++i) |
16 | pt.buffer[i] = i; |
17 | int x = s_global - g_global - pt.y; // breakpoint 1 |
18 | { |
19 | int x = 42; |
20 | { |
21 | int x = 72; |
22 | s_global = x; // breakpoint 2 |
23 | } |
24 | } |
25 | return test_indexedVariables(); // breakpoint 3 |
26 | } |
27 | |
28 | int test_indexedVariables() { |
29 | int small_array[5] = {1, 2, 3, 4, 5}; |
30 | int large_array[200]; |
31 | std::vector<int> small_vector; |
32 | std::vector<int> large_vector; |
33 | small_vector.assign(n: 5, val: 0); |
34 | large_vector.assign(n: 200, val: 0); |
35 | return 0; // breakpoint 4 |
36 | } |
37 | |