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 k=3; » char name[24]="My %d name is Earl.\n"; » printf("Hello world\n"); » printf("k: %d\n", k); » printf(name, k); » name8='X'; » printf(name, k); » name12='\0'; » printf(name, k); » return 0;
}
Memory

Fixed strings

134
135
'H' 'e'
136
137
138
139
140
141
142
143
'l' 'l' 'o' ' ' 'w' 'o' 'r' 'l'
144
145
146
147
148
149
150
151
'd' '\n' '\0'
?
?
?
?
?
160
161
162
163
164
165
166
167
?
?
?
?
'k' ':' ' ' '%'
168
169
170
'd' '\n' '\0'

main()

304
305
306
307
308
309
310
311
k = 3
name = 'M' 'y' ' ' '%'
312
313
314
315
316
317
318
319
'd' ' ' 'n' 'a' 'm' 'e' ' ' 'i'
320
321
322
323
324
325
326
327
's' ' ' 'E' 'a' 'r' 'l' '.' '\n'
328
329
330
331
'\0' '\0' '\0' '\0'

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

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

Hello world
k: 3
My 3 name is Earl.
My 3 naXe is Earl.
My 3 naXe i
                                                                                                                                                                                                                                                                       

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