Re:Deciding to rewrite getaddrinfo in rust
by mbrock on Tuesday February 23, 2016 @11:34AM
(#11160046)
http://cdecl.org/
const char *foo
declares a pointer to a char that is constant. const char * const foo
declares a constant pointer to a char that is constant.
Correct me if I'm wrong (I haven't programmed in C++ in forever), but aren't "name" and "service" pointers to constant arrays of characters rather than constant pointers to (mutable) arrays of characters? In the first case, you're saying you have a variable that points to a memory location; the variable itself can be changed, but the data in memory at that location cannot. In the second case, you're saying that you cannot change the variable that contains the memory address; however, you can change the data in memory at that location.
(And if I remember correctly, I believe there are also such things as constant pointers to constant memory...)