I have an array allocated like this
typedef unsigned char Byte;
Byte *MyArray = (Byte*)malloc(10);
Now I want to find the address of the 5th element (index 4) in the array. So do I do this:
ElementAddr = &MyArray
Or do I do this:
ElementAddr = &(MyArray)
Note the parentheses around the thing which I'm trying to get the address for. Are these parentheses needed? I did that because it's an array, and I want to make sure that it knows I'm trying to get the address for the array cell at index 4, not get the base address of the array and then add 4 to it (though these would be the same with Byte sized arrays, it wouldn't be the same for arrays with larger data types). However, would it exhibit this undesired behavior if I left off the parentheses? I hope somebody knows. I'm trying to make my code as small as possible, and it would be nice to remove extra parentheses if possible.