The value of
ch
will be -56. You can check that by printing it:
printf("ch = %d\n", ch);
If you want to be really sure you can print the address:
printf("addr of arr: %p, addr of arr[h]: %p\n", arr, &arr[ch]);
The output might look like this:
addr of arr: 0xbe8db170, addr of arr[h]: 0xbe8db090
As a result, the array is accessed out of bounds. When enabling all compiler warnings, you should get an appropriate warning.
Your assumption that
arr[200]
is 'H' in this line is wrong:
printf("val = %c\r\n", arr[ch])
This can be verified by passing -56 and 200 instead of
ch
.