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...
struct foo { double thing; float bar; int k; };
void stfun(struct foo wilber){
  ...
» wilber.thing=wilber.thing*2; » wilber.bar=wilber.thing-1.1; » wilber.k=wilber.bar; » printf("stfun()'s wilber.thing is: %g\n", wilber.thing);
} int main(){
  ...
» double hello=7.3; » struct foo wilber; » struct foo stuff[3]; » wilber.bar=1.2; » wilber.thing=2.1*wilber.bar; » stuff[1].bar=wilber.bar; » stfun(wilber); » printf("main()'s wilber.thing is: %g\n", wilber.thing); » return 0;
}
Memory

stfun()

128
129
130
131
132
133
134
135
wilber.thing = 2.5200001
136
137
138
139
140
141
142
143
wilber.bar = 1.20000005
wilber.k = 134537824

main()

192
193
194
195
196
197
198
199
hello = 7.3
200
201
202
203
204
205
206
207
wilber.thing = -1.26654476e+267
208
209
210
211
212
213
214
215
wilber.bar = 8.742247e-34
wilber.k = 134537824
216
217
218
219
220
221
222
223
stuff[0].thing = 2.18846621e-314
224
225
226
227
228
229
230
231
stuff[0].bar = -nan
stuff[0].k = -144802392
232
233
234
235
236
237
238
239
stuff[1].thing = 4.24399158e-312
240
241
242
243
244
245
246
247
stuff[1].bar = -4.61704314e+33
stuff[1].k = -143073280
248
249
250
251
252
253
254
255
stuff[2].thing = -1.26663533e+267
256
257
258
259
260
261
262
263
stuff[2].bar = 3.99884076e-34
stuff[2].k = 134537628

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

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

stfun()'s wilber.thing is: 5.04
main()'s wilber.thing is: 2.52
                                                                                                                                                                                                                                                                       

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