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...
// // Convert a string to UPPER CASE //
void shout(char string[]){
  ...
» int i; » for (i=0; stringi!='\0'; ++i) { » stringi=toupper(stringi); }
} int main(){
  ...
» char helloworld[16]="Hello, world"; » printf("The original string is: %s\n", helloworld); » shout(helloworld); » printf("The upper-case string is: %s\n", helloworld); » return 0;
}
Memory

shout()

132
133
134
135
string = 212
144
145
146
147
i = -765992

main()

212
213
214
215
helloworld = 'H' 'e' 'l' 'l'
216
217
218
219
220
221
222
223
'o' ',' ' ' 'w' 'o' 'r' 'l' 'd'
224
225
226
227
'\0' '\0' '\0' '\0'

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

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

The  original  string is: Hello, world
The upper-case string is: HELLO, WORLD
                                                                                                                                                                                                                                                                       

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