170
|
1
|
|
2 short gj;
|
|
3 short gi;
|
|
4
|
|
5 short a[100];
|
|
6 unsigned short b[100];
|
|
7 unsigned char c[100];
|
|
8
|
278
|
9 short data[] = {10,20,-40,-50};
|
|
10 unsigned short udata[] = {10,20,-40,-50};
|
170
|
11
|
|
12 short f(short i,unsigned short j,unsigned short k,short m,short a);
|
|
13 unsigned
|
|
14 short g(short i,unsigned short j,unsigned short k,short m,short a);
|
|
15
|
|
16 main()
|
|
17 {
|
|
18 int ii;
|
|
19 short i,k,*p;
|
|
20 unsigned short j,m,*up;
|
|
21 unsigned char g0,h0;
|
|
22 char g1,h1;
|
|
23 unsigned short sg0,sh0;
|
|
24 short sg1,sh1;
|
|
25 unsigned char *pg0,*ph0;
|
|
26 char *pg1,*ph1;
|
|
27 unsigned short *psg0,*psh0;
|
|
28 short *psg1,*psh1;
|
|
29
|
|
30
|
|
31 i = -3;
|
|
32 j = 3;
|
|
33 k = 44;
|
|
34 k = i*j+3+k;
|
|
35 m = i*j-7+k;
|
427
|
36 printf("#0035:%d %d %d\n",i,k,m);
|
170
|
37
|
|
38 g0 = 123;
|
|
39 g0++; --g0;
|
|
40 ++g0; g0--;
|
427
|
41 printf("#0040:g0=%d\n",g0);
|
170
|
42 g1 = -123;
|
|
43 g1++; --g1;
|
|
44 ++g1; g1--;
|
427
|
45 printf("#0044:g1=%d\n",g1);
|
170
|
46
|
|
47 sg0 = 123;
|
|
48 sg0++; --sg0;
|
|
49 ++sg0; sg0--;
|
427
|
50 printf("#0049:sg0=%d\n",sg0);
|
170
|
51 sg1 = -123;
|
|
52 sg1++; --sg1;
|
|
53 ++sg1; sg1--;
|
427
|
54 printf("#0053:sg1=%d\n",sg1);
|
170
|
55
|
|
56 pg0 = &g0;
|
|
57 ph0 = &h0;
|
|
58 *pg0 = 123;
|
|
59 //*pg0++; *--pg0;
|
|
60 //*++pg0; *g0--;
|
427
|
61 printf("#0060:g0=%d\n",*pg0);
|
170
|
62 pg1 = &g1;
|
|
63 ph1 = &h1;
|
|
64 *pg1 = -123;
|
|
65 //*pg1++; --*pg1;
|
|
66 //++*pg1; *pg1--;
|
427
|
67 printf("#0066:g1=%d\n",*pg1);
|
170
|
68
|
|
69 psg0 = &sg0;
|
|
70 psh0 = &sh0;
|
|
71 *psg0 = 123;
|
|
72 //*sg0++; *--sg0;
|
|
73 //*++sg0; *sg0--;
|
427
|
74 printf("#0073:sg0=%d\n",*psg0);
|
170
|
75 psg1 = &sg1;
|
|
76 psh1 = &sh1;
|
|
77 *psg1 = -123;
|
|
78 //*sg1++; *--sg1;
|
|
79 //*++sg1; *sg1--;
|
427
|
80 printf("#0079:sg1=%d\n",*psg1);
|
170
|
81
|
|
82
|
|
83 h0 = g0 - 20;
|
|
84 c[33] = g0;
|
|
85
|
427
|
86 if (i==j) { printf("#0085:i==j\n"); } else { printf("i!=j\n"); }
|
170
|
87
|
|
88 a[33] = i;
|
|
89 b[33] = 105;
|
427
|
90 printf("#0089:i=%d\n",i);
|
|
91 printf("#0090:j=%d\n",j);
|
170
|
92 i++; --i;
|
|
93 j++; --j;
|
427
|
94 printf("#0093:i=%d\n",i);
|
|
95 printf("#0094:j=%d\n",j);
|
170
|
96 gi = 3333;
|
|
97 gj = 6666;
|
|
98 gi++; --gi;
|
|
99 gj++; --gj;
|
427
|
100 printf("#0099:gi=%d\n",gi);
|
|
101 printf("#0100:gj=%d\n",gj);
|
170
|
102
|
427
|
103 printf("#0102:k=%d\n",k);
|
|
104 printf("#0103:m=%d\n",m);
|
|
105 printf("#0104:a[33]=%d\n",a[33]);
|
|
106 printf("#0105:b[33]=%d\n",b[33]);
|
|
107 printf("#0106:a[33]=%d\n",++a[33]);
|
|
108 printf("#0107:b[33]=%d\n",b[33]--);
|
170
|
109
|
427
|
110 printf("#0109:g0=%d\n",g0);
|
|
111 printf("#0110:h0=%d\n",h0);
|
|
112 printf("#0111:c[33]=%d\n",c[33]);
|
170
|
113
|
|
114 p = data;
|
427
|
115 printf("#0114:*p++ = %d\n",*p++);
|
|
116 printf("#0115:*++p = %d\n",*++p);
|
170
|
117 *p++ = -343;
|
427
|
118 printf("#0117:*p-- = %d\n",*p--);
|
|
119 printf("#0118:*--p = %d\n",*--p);
|
170
|
120 up = udata;
|
427
|
121 printf("#0120:*up-- = %d\n",*up--);
|
|
122 printf("#0121:*--up = %d\n",*--up);
|
170
|
123 *up++ = 65530;
|
427
|
124 printf("#0123:*up-- = %d\n",*up--);
|
|
125 printf("#0124:*--up = %d\n",*--up);
|
170
|
126
|
|
127
|
|
128 ii = f(i,j,k,m,a[33]);
|
427
|
129 printf("#0128:f()=%d\n",ii);
|
170
|
130 ii = g(i,j,k,m,a[33]);
|
427
|
131 printf("#0130:f()=%d\n",ii);
|
172
|
132 return 0;
|
170
|
133 }
|
|
134
|
|
135 short f(short i,unsigned short j,unsigned short k,short m,short a)
|
|
136 {
|
|
137 return i+j*k-m/a;
|
|
138 }
|
|
139
|
|
140 unsigned
|
|
141 short g(short i,unsigned short j,unsigned short k,short m,short a)
|
|
142 {
|
|
143 return i+j*k-m/a;
|
|
144 }
|