const void *a
This is defined as a pointer a,a can point to a value of the arbitrary type, but the value it points to must be a constant.
In this case, we cannot change the object being pointed to, but we can make the pointer point to other objects.
Like what:
The const void *a;*a=0x123;//is just a compile pass, because the *a is a const value.
The const value cannot be changed.
const int M=1; const int n=2;
a=&m; a=&n;//compilation can be passed.
void* Const A
This is defined by a const pointer a. A can point to a random type of value, but a is a constant pointer to an object.
We cannot change the address stored in the pointer. But you can change the object that the pointer points to.
Like what:
void* const A; this definition: *a=0x123; it's no problem,
But A= (void*) &b; is no good. Because A is a const variable.
Such as:
int m=1; NT n=2;
a=&m; a=&n;//compilation is unsuccessful.
Can say so. const void *a; The const modifier is *a. In void* const A, the const modifier is a.
The difference between const void *a and void *const A