Hi,
i wanted clarification about pointers.
1) if i declare something like
it creates pointer variable, which is not pointing to a variable yet, but would point to integer variable. so, if i access &p, is it a valid address or junk?Code:int *p ;
2) when i declare a void pointer like
p1 then holds address of another variable, whose type is not known. Is this addressCode:void *p1;
a valid one ? if so, does it mean that is points to a variable that could be 1 byte, 2 byte etc depending upon the the type?
3) Null pointer points to reserved space, which could be 0 . so, does NULL pointer have a type?
4)IN C, void to pointer type T is implicit. does it hold for void to NULL pointer too?
for example, can i have a function like this
thanksCode:void * f(void) { some code return NULL; }



2Likes
LinkBack URL
About LinkBacks



