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...
typedef struct ellipse { float centre[2]; float axes[2]; float orientation; float area; }Ellipse; #define PI 3.14159265358979
int main(){
  ...
» Ellipse *e=NULL; » e=malloc(sizeof *e); » if (e==NULL) { » fprintf(stderr, "Out of memory\n"); » exit(99); } » e->orientation=PI/4; » printf("Orientation: %g\n", e->orientation); » return 0;
}
Memory

Allocated memory

128
129
130
131
132
133
134
135
128.centre[0] = 3.20433e-09
128.centre[1] = -5.71844e+07
136
137
138
139
140
141
142
143
128.axes[0] = -0.169598
128.axes[1] = 3.07833e-25
144
145
146
147
148
149
150
151
128.orientation = -7.07997567e+24
128.area = 4.30395931e-39

main()

280
281
282
283
e = NULL

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

The actual address of allocated memory is the
address shown plus 142365272 (0x87C5258).

Show Advanced options

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

Output

Orientation: 0.785398
                                                                                                                                                                                                                                                                       

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