In C, pointers and array names can be mixed.
For example
Char * P;
During access, * P is the same as P [0], and * (p + 1) is the same as P [1.
For arrays
Char B [5];
During access, B [0] is the same as * B, and B [2] is the same as * (B + 2.
In general communications (such as serial ports), byte transmission is usually used. For example, float or long int,
4 bytes. My method is to take its address, forcibly convert it to a char pointer, and use it as an array.
Float X;
Sbuf = (char *) & X) [0];
Sbuf = (char *) & X) [1];
Sbuf = (char *) & X) [2];
Sbuf = (char *) & X) [3];
At the time of receiving the message, it was just reversed.
What's more interesting is that for the array form, the array name and the following offset can be changed at will.
Char buff [10];
// Or use char * buff = & buffer;
Buff [3] = 0xaa;
3 [buff] = 0xaa; // It is actually the same, fainting...
Therefore, I think the compiler does this: for expressions like XXX [YYY], it will be converted to * (xxx + YYY ),
Therefore, it doesn't matter if you write XXX [YYY] Or YYY [XXX]. Avoid using SARS. If something happens, you may not be responsible for it...