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 NDIM 2 typedef struct particle { float mass; float x[NDIM]; }Particle;
int main(){
  ...
» int n=4; » 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 = -7.29316008e+29
128.x[0] = -11.982
136
137
138
139
128.x[1] = 1.82776e-38

144
145
146
147
148
149
150
151
144.mass = -3.72868811e+25
144.x[0] = 116.093
152
153
154
155
144.x[1] = 1.79069e-38

160
161
162
163
164
165
166
167
160.mass = 1.22264403e-14
160.x[0] = -3.70394e-16
168
169
170
171
160.x[1] = 1.94798e-38

176
177
178
179
180
181
182
183
176.mass = -9619464
176.x[0] = 1.02153e+09
184
185
186
187
176.x[1] = 1.90752e-38

main()

320
321
322
323
324
325
326
327
n = 4
p = -4152465293

main(): for()

328
329
330
331
i = 0

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

The actual address of allocated memory is the
address shown plus 153084504 (0x91FE258).

Show Advanced options

.
                                                                                                                                                                                                                                                                       

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