Skip to content
EMPS intranet

Back to top
Hi!   Hi!           Start program

Try stepping through the code


  Value and type of last evaluated expression: Address of array element: Address of array elementx:  (none)

Your browser does not support the canvas element which will make some the features unavailable.

If you are using Internet Explorer within the University of Exeter try going to the Settings menu (probably the gear shape at the top right of this page), selecting "Compatibility View settings", unchecking "Display intranet sites in Compatibility View" and reloading this page.

Code

 Header...
#define NX 3 #define NY 2
int main(){ » int grid[NX][NY]={{1,2},{3,4},{5,6}}; » int x, y; » for (x=0; x<NX; ++x) for (y=0; y<NY; ++y) printf("grid[%d][%d] is %d\n", x, y, grid[x]y); » return 0; }
...
Memory

main()

132
133
134
135
x = 2000958970
136
137
138
139
140
141
142
143
y = 1820977181
grid[0][0] = 1
144
145
146
147
148
149
150
151
grid[0][1] = 2
grid[1][0] = 3
152
153
154
155
156
157
158
159
grid[1][1] = 4
grid[2][0] = 5
160
161
162
163
grid[2][1] = 6

NB: the actual memory address of each variable is the
address shown plus 4291359608 (0xFFC8F378).

Show Advanced options

.
Show output (Before looking at the output, work out what you think it put should be and see if you are right.)

Output

grid[0][0] is 1
grid[0][1] is 2
grid[1][0] is 3
grid[1][1] is 4
grid[2][0] is 5
grid[2][1] is 6
                                                                                                                                                                                                                                                                       

Validate   Link-check © Copyright & disclaimer Share
Back to top