I have a code that I passed a certain place in the memory. This place in the memory is pointing to an array
uint32_t *ps2 = NULL;
uint32_t src_address = 0x1ffffc3;
How can I read the value of the array from this address?
I tried to cast it as follows
*ps2 = (void *)src_address;
but it gives me an error: invalid conversion from ‘void*’ to ‘uint32_t
Regards,
Basically I have the address that I need to access in the src_address and I need to convert it so I can access its contentaddress is address. You can convert the type of the variable, not the address. You have an addressuint32_t src_address. You can convert the type touint32_t *src_address_pnt = (uint32_t*)src_address. If your compiler is really pedantic, tryuint32_t *src_address_pnt = (uint32_t*)(void*)(uintptr_t)src_address. Also please post full exact error message, include relevant compiler and compiler options.