I am learning to code the NRF24L01 transceiver module and came across some new commands.
I have tried to search for these but I couldn't find a clear answer.
That is basic C++ array allocation/initialization/usage.
You can get a meaningful length from the initializer, so you don't have to size the array explicitly.
The packet will be automatically expanded to 32 bytes in your configuration.
On the receiving side, you only know that 32 bytes will be received,
so you have to allocate a buffer for the packet.
The & is needed for non-array elements to get their address,
it is not needed for an array, that is also a pointer to its start.
There's a subtle difference when using arrays as function parameters:
char myArray[32];
myFunction1(myArray); <----- myArray decays to a 'char *'
myFunction2(&myArray); <----- myArray decays to a pointer to a char array of length 32
In that case, correct since the 'void *' could only be legally recast and dereferenced inside the function as a 'uint8_t *'. So all pointer math would be in terms of bytes, not chunks of 32 bytes.
I wouldn't recommend the one from tutorialspoint at all: It is terribly outdated, promotes questionable practices, and parts of it are plain wrong.
I'd recommend learncpp.com instead.