does a pointer also occupy memory space

India
March 9, 2007 11:50pm CST
how actually is pointer implemented in c.Does a pointer also have memory occupied
1 person likes this
11 responses
• India
10 Mar 07
a pointer is an like a normal variable that stores the address of another variable in it as a value.it is also called as reference variable,which points the memory location.yes like other variables which occupies memory location,it also occupies memory location
• India
10 Mar 07
can we say that it is some form of aliasing..
1 person likes this
• India
9 Jul 07
No...it is not alias. Pointer and reference are two different things. Reference may be considered as a alias but not pointer.
@fglswh (66)
• China
18 Sep 09
yes, a pointer is a normal variable, if you don't understand this, think in this way: we can get the address of a pointer variable, so since it has address, it is a variable
@aseru48 (173)
• United States
24 Apr 07
A pointer has the address of a variable stored. It has to occupy space, because it has to store the address.
• India
9 Jul 07
Pointer does not occupy any space. What you mean may that pointer variable.... Am I right? If yes then Pointer variable occupies the memory space of an int.
• India
9 Jul 07
Pointer does not occupy any space. What you mean may that pointer variable.... Am I right? If yes then Pointer variable occupies the memory space of an int.
@mnsrwt123 (2057)
• India
1 Apr 08
well i don't think a pointer is occupying a single memory, and you are actualy rite that how can they implement without memory...lol
@damnsam (67)
• India
31 Mar 07
A pointer is actually a variable that contains memory locations. Pointer arithmetics decide by how much the value of a pointer increases in one go. For example, an integer pointer increases by two(four) bytes (depending upon implementation) at every increase. Yes, pointers do occupy memory. But it is not the data-type that decides the memory-size of a pointer variable but the type of pointer. There are three type of pointers- Near, Far and Huge. Near pointers are used for referencing memory inside the program. Far and huge are used to refer the memory outside the range of program. Near is 16-bit, far and huge are 32-bit. The difference between far and huge is that huge is limited in its operation. And these limits can be overcome using huge pointers.
• India
13 Mar 07
ya thanks dear.................. i also had this question and was in confused thanks a lot...
@Phoniex (74)
• India
2 Apr 07
pointers does occupy space in the memory as it has to store memory information and data both.
• India
30 Mar 07
Pointer is also a variable,is having some special characteristics.i.e.It can store the address of another variable of same. for example int*p; this pointer can store only integer variables addresses only.u can't store the char,float variables addresess. int x=10;char ch='a'; u can write p=&x;but u can't write p=&ch; if it is int it takes 2bytes memory(depends on the compiler).if char takes 1byte etc....
@techvin (13)
• India
10 Apr 07
Yes, it does occupies 2 bytes of memory in a 16 bit system and 4 bytes in a 32 bit sysytem