Kuba0040
Well-known member
Hello,
I have a pretty simple piece of code. I want to store the memory address of TestChunkMemory into TestChunkAdress, as shown here:
However, the compiler always gives me this warning:
warning: invalid conversion from 'int32_t* {aka long int*}' to 'uint32_t {aka long unsigned int}' [-fpermissive]
The code compiles and works just fine though, any ideas of how I can get rid of this warning? Also, are there other ways to store the memory address of a variable to then be able to access it quickly? Why not just use a pointer? -> I can't use a pointer here as I must be able to pass this memory address to functions. Using pointers like so causes it to change:
Thank You for the help.
I have a pretty simple piece of code. I want to store the memory address of TestChunkMemory into TestChunkAdress, as shown here:
Code:
int32_t TestChunkMemory[64];
uint32_t TestChunkAdress=&TestChunkMemory;
However, the compiler always gives me this warning:
warning: invalid conversion from 'int32_t* {aka long int*}' to 'uint32_t {aka long unsigned int}' [-fpermissive]
The code compiles and works just fine though, any ideas of how I can get rid of this warning? Also, are there other ways to store the memory address of a variable to then be able to access it quickly? Why not just use a pointer? -> I can't use a pointer here as I must be able to pass this memory address to functions. Using pointers like so causes it to change:
Code:
void test_function(int32_t *LocalPointer)
{
Serial.print("Local adress: ");
println64(&LocalPointer);
}
Thank You for the help.