1 | #include <stdio.h> |
2 | |
3 | void set_char(void) |
4 | { |
5 | char i = 'a'; |
6 | printf(format: "before (char) i = %c\n" , i); |
7 | printf(format: "after (char) i = %c\n" , i); // Set break point #1. //// break $source:$line |
8 | } |
9 | |
10 | void set_uchar(void) |
11 | { |
12 | unsigned char i = 'a'; |
13 | printf(format: "before (unsigned char) i = %c\n" , i); |
14 | printf(format: "after (unsigned char) i = %c\n" , i); //// break $source:$line |
15 | } |
16 | |
17 | void set_short(void) |
18 | { |
19 | short i = 33; |
20 | printf(format: "before (short) i = %i\n" , i); |
21 | printf(format: "after (short) i = %i\n" , i); //// break $source:$line |
22 | } |
23 | |
24 | void set_ushort(void) |
25 | { |
26 | unsigned short i = 33; |
27 | printf(format: "before (unsigned short) i = %i\n" , i); |
28 | printf(format: "after (unsigned short) i = %i\n" , i); // Set break point #2. //// break $source:$line |
29 | } |
30 | |
31 | void set_int(void) |
32 | { |
33 | int i = 33; |
34 | printf(format: "before (int) i = %i\n" , i); |
35 | printf(format: "after (int) i = %i\n" , i); //// break $source:$line |
36 | } |
37 | |
38 | void set_uint(void) |
39 | { |
40 | unsigned int i = 33; |
41 | printf(format: "before (unsigned int) i = %u\n" , i); |
42 | printf(format: "after (unsigned int) i = %u\n" , i); //// break $source:$line |
43 | } |
44 | |
45 | void set_long(void) |
46 | { |
47 | long i = 33; |
48 | printf(format: "before (long) i = %li\n" , i); |
49 | printf(format: "after (long) i = %li\n" , i); // Set break point #3. //// break $source:$line |
50 | } |
51 | |
52 | void set_ulong(void) |
53 | { |
54 | unsigned long i = 33; |
55 | printf(format: "before (unsigned long) i = %lu\n" , i); |
56 | printf(format: "after (unsigned long) i = %lu\n" , i); //// break $source:$line |
57 | } |
58 | |
59 | void set_float(void) |
60 | { |
61 | float i = 2.25; |
62 | printf(format: "before (float) i = %g\n" , i); |
63 | printf(format: "after (float) i = %g\n" , i); //// break $source:$line |
64 | } |
65 | |
66 | void set_double(void) |
67 | { |
68 | double i = 2.25; |
69 | printf(format: "before (double) i = %g\n" , i); |
70 | printf(format: "after (double) i = %g\n" , i); // Set break point #4. //// break $source:$line |
71 | } |
72 | |
73 | void set_long_double(void) |
74 | { |
75 | long double i = 2.25; |
76 | printf(format: "before (long double) i = %Lg\n" , i); |
77 | printf(format: "after (long double) i = %Lg\n" , i); // Set break point #5. //// break $source:$line |
78 | } |
79 | |
80 | void set_point (void) |
81 | { |
82 | struct point_tag { |
83 | int x; |
84 | int y; |
85 | }; |
86 | struct point_tag points_2[2] = { |
87 | {1,2}, |
88 | {3,4} |
89 | }; |
90 | } |
91 | |
92 | int main (int argc, char const *argv[]) |
93 | { |
94 | // Continue to the breakpoint in set_char() |
95 | set_char(); //// continue; var i; val -set 99 1 |
96 | set_uchar(); //// continue; var i; val -set 99 2 |
97 | set_short(); //// continue; var i; val -set -42 3 |
98 | set_ushort(); //// continue; var i; val -set 42 4 |
99 | set_int(); //// continue; var i; val -set -42 5 |
100 | set_uint(); //// continue; var i; val -set 42 6 |
101 | set_long(); //// continue; var i; val -set -42 7 |
102 | set_ulong(); //// continue; var i; val -set 42 8 |
103 | set_float(); //// continue; var i; val -set 123.456 9 |
104 | set_double(); //// continue; var i; val -set 123.456 10 |
105 | set_long_double(); //// continue; var i; val -set 123.456 11 |
106 | set_point (); //// continue |
107 | return 0; |
108 | } |
109 | |