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 NX 2 #define NY 2 #define IMAX 16 typedef struct foostr { int n; float vals[]; }Foostr; void foobar (float *,int);
void foo(int x){
  ...
» printf("foo! am here\n");
} void tfun(int x){
  ...
» printf("tfun! am here %d\n", x);
} int main(){
  ...
» int found=0; » char image[NY][NX]; » int ix, iy, nf; » char letters[32]="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; » int sizes[IMAX]; » Foostr *q; » q=malloc(sizeof *q+4*sizeof q->vals[0]); » q->vals2=5.6; » tfun((foo(1),1)); » return 0;
}
Memory

Allocated memory

128
129
130
131
132
133
134
135
128.n = 1577562455
128.vals[0] = -1.79219e+22
136
137
138
139
140
141
142
143
128.vals[1] = -4.27885e+29
128.vals[2] = 4.21092
144
145
146
147
128.vals[3] = 9.71332e-39

foo()

280
281
282
283
x = 1

tfun()

280
281
282
283
x = 1

main()

312
313
314
315
316
317
318
319
q = -4155327088
sizes[0] = 134909960
320
321
322
323
324
325
326
327
sizes[1] = -4729208
sizes[2] = -144820222
328
329
330
331
332
333
334
335
sizes[3] = 134910312
sizes[4] = 134909960
336
337
338
339
340
341
342
343
sizes[5] = -144819367
sizes[6] = -143474688
344
345
346
347
348
349
350
351
sizes[7] = 134910312
sizes[8] = 134909960
352
353
354
355
356
357
358
359
sizes[9] = -144866583
sizes[10] = -144866367
360
361
362
363
364
365
366
367
sizes[11] = 134910312
sizes[12] = 134537424
368
369
370
371
372
373
374
375
sizes[13] = 134537228
sizes[14] = 1
376
377
378
379
380
381
382
383
sizes[15] = -4729436
?
?
?
?
408
409
410
411
412
413
414
415
?
?
?
?
nf = 134537228
416
417
418
419
image[0] = ' ' '\0' image[1] = '\0' '\0'

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

The actual address of allocated memory is the
address shown plus 134918744 (0x80AB258).

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

foo! am here
tfun! am here 1
                                                                                                                                                                                                                                                                       

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