Skip to content
EMPS intranet

Back to top
Hi!   Hi!           Start main()

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 N 10
int main(){
  ...
» float ar[N]; » int j; » for (j=0; j<N; ++j) arj=j*j; » j=N/2; » printf("%g\n", arj); » return 0;
}
Memory

main()

128
129
130
131
132
133
134
135
j = 148840808
ar[0] = 3.99819e-34
136
137
138
139
140
141
142
143
ar[1] = 3.9981e-34
ar[2] = 1.4013e-45
144
145
146
147
148
149
150
151
ar[3] = -nan
ar[4] = -4.27687e+33
152
153
154
155
156
157
158
159
ar[5] = 1.4013e-45
ar[6] = 2.8026e-43
160
161
162
163
164
165
166
167
ar[7] = -4.38126e+33
ar[8] = -4.812e+33
168
169
170
171
ar[9] = 1.4013e-45

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

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

Output

25
                                                                                                                                                                                                                                                                       

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