For example, int array[ 10] and the address of the array is 0x7FFFFF00, then when accessing array [3], the computer calculates as follows:
The size of each integer is 4 bytes, so the address of the array is multiplied by 3 to get 0x7FFFFF0C, so the values of these 4 bytes from 0x7FFFFF0C to 0x7FFFFF0F are the values of array [3].
So no matter what the incoming subscript is, you can theoretically calculate an address, but this address may not be valid. If the address is invalid, there will be segmentation error, that is, array out of bounds/address access out of bounds. Now compilers will think that subscripts are only integer variables, but the operating system will still monitor them during execution, otherwise it will affect the operation of other programs.
For example, A = {1, 2,4,5,7} and B = {1, 2,3,4,5,6,7,8}, then b[a[3]] = b[5]=6, which is allowed.