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...
// Small 2-d allocation test #define LEN 4 #define N 3
int main(){
  ...
» float * *ar=NULL; » ar=malloc(4*sizeof *ar); » ar0=malloc(LEN*sizeof *ar[0]); » ar1=malloc(LEN*sizeof *ar[1]); » ar2=malloc(LEN*sizeof *ar[2]); » ar3=NULL; » ar[1]2=13.1; » return 0;
}
Memory

Allocated memory

128
129
130
131
132
133
134
135
128[0] = 906854579
128[1] = 151247196
136
137
138
139
140
141
142
143
128[2] = 545010939
128[3] =

152
153
154
155
156
157
158
159
152[0] = 1.0573e-21
152[1] = 6.72754e-26
160
161
162
163
164
165
166
167
152[2] = -1.03672e+26
152[3] = 1.47697e-38

176
177
178
179
180
181
182
183
176[0] = 7.74366e+20
176[1] = 9.73748e+33
184
185
186
187
188
189
190
191
176[2] = -5.89479e-36
176[3] = 1.17564e-38

200
201
202
203
204
205
206
207
200[0] = 1.03712e-24
200[1] = 9.58176e-35
208
209
210
211
212
213
214
215
200[2] = -1.87665e+30
200[3] = 1.48612e-38

main()

344
345
346
347
ar = NULL

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

The actual address of allocated memory is the
address shown plus 139752024 (0x8547258).

Show Advanced options

.
                                                                                                                                                                                                                                                                       

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