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...
// Demonstrate a memory leak
int main(){
  ...
» int *dummy; » for ( int i=0;i<6; ++i) dummy=malloc(2*sizeof *dummy);// ! » return 0;
}
Memory

Allocated memory

128
129
130
131
132
133
134
135
128[0] = -940901398
128[1] = 11679240

144
145
146
147
148
149
150
151
144[0] = 836223702
144[1] = 1757549

160
161
162
163
164
165
166
167
160[0] = 56129073
160[1] = 12737023

176
177
178
179
180
181
182
183
176[0] = 1031079298
176[1] = 1177220

192
193
194
195
196
197
198
199
192[0] = -207424685
192[1] = 15442250

208
209
210
211
212
213
214
215
208[0] = -1891537164
208[1] = 16718188

main()

348
349
350
351
dummy = -4155935990

main(): for()

352
353
354
355
i = 0

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

The actual address of allocated memory is the
address shown plus 164217432 (0x9C9C258).

Show Advanced options

.
                                                                                                                                                                                                                                                                       

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