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...
struct foo { float mass; float pos[2]; float v[2]; char *name; };
int main(){
  ...
» struct foo wilber[2]; » struct foo *w; » w=wilber; » scanf("%g", &wilber[1].mass); » scanf("%g", &w->pos[0]); » scanf("%g %g", &wilber[1].pos0, &wilber[1].pos1); » printf("Here: %g %g\n", wilber[1].pos0, wilber[1].pos1); » return 0;
}
Memory

main()

128
129
130
131
132
133
134
135
w = -4158131212
wilber[0].mass = 1.40129846e-45
136
137
138
139
140
141
142
143
wilber[0].pos[0] = -nan
wilber[0].pos[1] = -4.55955e+33
144
145
146
147
148
149
150
151
wilber[0].v[0] = 1.4013e-45
wilber[0].v[1] = 2.8026e-43
152
153
154
155
156
157
158
159
wilber[0].name = -142016161
wilber[1].mass = -5.09468776e+33
160
161
162
163
164
165
166
167
wilber[1].pos[0] = 1.4013e-45
wilber[1].pos[1] = -4.66401e+33
168
169
170
171
172
173
174
175
wilber[1].v[0] = 3.99934e-34
wilber[1].v[1] = 3.99925e-34
176
177
178
179
wilber[1].name = -4292669927

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

Show Advanced options

.

Input was:

2.4 5.61 7.92
2.4 5.61 7.92

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

Output

Here: 7.92 2.4
                                                                                                                                                                                                                                                                       

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