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 numbers[10]; » for ( int i=0;i<10; ++i) { » printf("Please enter value %d\n", i); » scanf("%d", &numbersi); } » for ( int j=0;j<10; ++j) printf("Value %d: %d\n", j, numbersj); » return 0;
}
Memory

main(): for()

128
129
130
131
i = 0

: for()

128
129
130
131
j = 0

main()

132
133
134
135
numbers[0] = -145003096
136
137
138
139
140
141
142
143
numbers[1] = 1
numbers[2] = 200
144
145
146
147
148
149
150
151
numbers[3] = -144665785
numbers[4] = -143273984
152
153
154
155
156
157
158
159
numbers[5] = 1
numbers[6] = -144665570
160
161
162
163
164
165
166
167
numbers[7] = 134537490
numbers[8] = 134537294
168
169
170
171
numbers[9] = 1

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

Show Advanced options

.

Input was:

3 1 4 1 5 9 2 6 5 3 7
3 1 4 1 5 9 2 6 5 3 7

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

Output

Please enter value 0
Please enter value 1
Please enter value 2
Please enter value 3
Please enter value 4
Please enter value 5
Please enter value 6
Please enter value 7
Please enter value 8
Please enter value 9
Value 0: 3
Value 1: 1
Value 2: 4
Value 3: 1
Value 4: 5
Value 5: 9
Value 6: 2
Value 7: 6
Value 8: 5
Value 9: 3
                                                                                                                                                                                                                                                                       

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