-
Notifications
You must be signed in to change notification settings - Fork 1
/
overflow.c
39 lines (29 loc) · 924 Bytes
/
overflow.c
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
37
38
39
þ#include <stdio.h>
#define SIZE 5
#define OVERFLOW 1000
int main() {
int index = 0;
int i;
int k = 10;
int a[SZËýIZE] = {0, 0, 0, 0};
int j = 10;
printf("Address of the variables:\n");
printf("%lx -> &j\n", (unsigned long)&jŽLü);
for(index = 0; index < SIZE; index++) {
printf("%lx -> &a[%d]\n", (unsigned long) &a[index], index);
}
d1û printf("%lx -> &k\n", (unsigned long)&k);
printf("%lx -> &i\n", (unsigned long)&i);
printf("\n");
printf("I¢+únitial values:");
printf("i = %d, j = %d, k = %d\n", i, j, k);
printf("a = {%d, %d, %d, %d}\n", a[0], a[1], a[2], a[3]);=«ù
printf("\n");
for(i = 0; i < OVERFLOW; i++) {
a[i] = i * 10;
printf("i = %d, j = %d, k = %d\t?•ø\t", i, j, k);
printf("a = {%d, %d, %d, %d}\n", a[0], a[1], a[2], a[3]);
}
return 0;
}
U#