E
electric sheep
Hi, can somebody explain the following syntax to me.
This is straight from a gnu info file:
int
main(void)
{
/* Hashed form of "GNU libc manual". */
const char *const pass = "$1$/iSaq7rB$EoUw5jJPPvAPECNaaWzMK/";
I think the idea at play here is whether the pointer is constant or not ?
My guess is this:
const char * is a pointer to a "constant char" type ?
if you want the pointer itself to be constant too, you make that
const char *const ... ?
so the "*const" means the pointer itself is constant.
so,
int *const would be a "constant pointer" to an int, which itself may be changed however ?
I supposed I will play w/ the compiler to see if this is the right interpretation,
after typing this much though, i'm going to go ahead and send this off
%^)
e
This is straight from a gnu info file:
int
main(void)
{
/* Hashed form of "GNU libc manual". */
const char *const pass = "$1$/iSaq7rB$EoUw5jJPPvAPECNaaWzMK/";
I think the idea at play here is whether the pointer is constant or not ?
My guess is this:
const char * is a pointer to a "constant char" type ?
if you want the pointer itself to be constant too, you make that
const char *const ... ?
so the "*const" means the pointer itself is constant.
so,
int *const would be a "constant pointer" to an int, which itself may be changed however ?
I supposed I will play w/ the compiler to see if this is the right interpretation,
after typing this much though, i'm going to go ahead and send this off
%^)
e