C
Charles M. Reinke
OK, this may be a dumb question, but please bear with me. If I declare a
pointer:
int *p;
the memory space for a pointer is allocated, but is the memory space also
reserved for one integer, or not until I assign it some value such as:
*p = 7;
Also, how is this different (if at all) from the case where I create a null
pointer:
int *p;
p = NULL;
Is the memory space for one integer reserved in this case, or just the
memory space for a pointer with value 0?
This is actually a very simplified case of what I'm trying to do, but
hopefully my question is clearer this way.
Thanx!
pointer:
int *p;
the memory space for a pointer is allocated, but is the memory space also
reserved for one integer, or not until I assign it some value such as:
*p = 7;
Also, how is this different (if at all) from the case where I create a null
pointer:
int *p;
p = NULL;
Is the memory space for one integer reserved in this case, or just the
memory space for a pointer with value 0?
This is actually a very simplified case of what I'm trying to do, but
hopefully my question is clearer this way.
Thanx!