Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C language plastic array a[5][5] Each int variable has 4 bytes. If the storage address of a[0][0] is 1548 (decimal),
C language plastic array a[5][5] Each int variable has 4 bytes. If the storage address of a[0][0] is 1548 (decimal),
If this array is continuously stored in memory

It should be1548+4 * 2 * 5+4 * 2 (1548+the size of two int[5] arrays+the size of two int).

If it is not, it is not certain that it can be calculated by a[0][0], but the address of A should be determined.

I can't solve it because the pointer 1584 is not sure whether it is stored in the source address or a copied pointer according to the conditions you gave, so I can't do it&; (1548) get the address of a.

The algorithm for using addresses is as follows:

Suppose the address of a is int * * ptr _ a;;

Then & (a [2] [2]) = * (ptr _ a+2)+2;