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...
int main(){
  ...
» int n1, n2; » printf("Sizes?\n"); » scanf("%d %d", &n1, &n2); » float ( *pvar)[n2]; » pvar=malloc(n1*sizeof *pvar); » pvar[0]1=1; » return 0;
}
Memory

Allocated memory

128
129
130
131
132
133
134
135
128[0][0] = -0.0255355
128[0][1] = 3.90623e+30
136
137
138
139
140
141
142
143
128[0][2] = -7.11077e+33
128[0][3] = -7.0646e-26
144
145
146
147
148
149
150
151
128[1][0] = -1.04379e-26
128[1][1] = 1.07745e-24
152
153
154
155
156
157
158
159
128[1][2] = -1.9224e-32
128[1][3] = 1.32888e-18
160
161
162
163
164
165
166
167
128[2][0] = 1.71254e+09
128[2][1] = 8.77198e-21
168
169
170
171
172
173
174
175
128[2][2] = 2.4098e+32
128[2][3] = 1.73996e-38

main()

308
309
310
311
n1 = 200
312
313
314
315
316
317
318
319
n2 = -144977081
pvar = -136847400

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

The actual address of allocated memory is the
address shown plus 139031144 (0x8497268).

Show Advanced options

.

Input was:

3 4

Show output (Before looking at the output, work out what you think it put should be and see if you are right.)

Output

Sizes?
                                                                                                                                                                                                                                                                       

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