I have a simple function on c++ which takes 2 arguments:
read(uint32_t *buffer, uint32_t num_words){
...
}
When I try to call it I get an error because the arguments I pass are probably wrong unsigned long*, unsigned long
:
uint32_t addr = 5;
uint32_t buf[5];
read(buf,addr);
I'm not sure why this is wrong. Any ideas?
The problem might be because the compiler is not able to convert pointer to const pointer(that is array variable). Change the prototype of of read to read(uint32_t buffer [], uint32_t num_words).. This will work.