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 NDIM 2 typedef struct particle { float mass; float x[NDIM]; }Particle;
int main(){ » int n=8; » Particle *p; » for ( int i=0;i<n; ++i) p=malloc(sizeof *p); » return 0; }
...
Memory

Allocated memory

128
129
130
131
132
133
134
135
128.mass = -3.3055707e+30
128.x[0] = 2.17905e+27
136
137
138
139
128.x[1] = 12.4708

144
145
146
147
148
149
150
151
144.mass = -9.83336075e-29
144.x[0] = 2.90001e+20
152
153
154
155
144.x[1] = -2.49515e+09

160
161
162
163
164
165
166
167
160.mass = 76743328
160.x[0] = 0.00119223
168
169
170
171
160.x[1] = -1.39057e-21

176
177
178
179
180
181
182
183
176.mass = -3.50122945e+32
176.x[0] = 6.43681e+31
184
185
186
187
176.x[1] = 2.7423e-21

192
193
194
195
196
197
198
199
192.mass = -6.92960777e+31
192.x[0] = -2.38407e+37
200
201
202
203
192.x[1] = 2.06649e-06

208
209
210
211
212
213
214
215
208.mass = -6.96954805e-09
208.x[0] = 7.73725e+20
216
217
218
219
208.x[1] = 1027.94

224
225
226
227
228
229
230
231
224.mass = -1.06985811e+34
224.x[0] = -4.89214e+09
232
233
234
235
224.x[1] = -2.25578e+32

240
241
242
243
244
245
246
247
240.mass = 2.48885194e+17
240.x[0] = -4.96609e-12
248
249
250
251
240.x[1] = -4.60644e-36

main()

384
385
386
387
388
389
390
391
n = 8
p = -2551628847

main(): for()

392
393
394
395
i = 0

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

The actual address of allocated memory is the
address shown plus 162636016 (0x9B1A0F0).

Show Advanced options

.
                                                                                                                                                                                                                                                                       

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