Anyone can explain me what is the difference between two blocks of code below:
func1 (...)
{
int32_t index;
const int32_t *p;
p =& (index);
}
func2 (...)
{
const int32_t s;
s=10;
}
It is possible to declare a const pointer and then assign a value to it but it is not possible to declare a normal variable and then assign a value to it. Can somebody explain this to me?
I get a pc-lint error that I have to declare the const variable inside the function but I cannot do it. How can I get rid of this error?
Thank you so much.