 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
akhilesh natani Guest
|
Posted: Sat Sep 23, 2006 9:10 am Post subject: POINTERS |
|
|
hi sir,
sir i want to know a simple pointer concept.
Q) ..... when all of thw address are integer then why we uses the
pointer of type char,float etc. |
|
| Back to top |
|
 |
Bill Guest
|
Posted: Sat Sep 23, 2006 9:10 am Post subject: Re: POINTERS |
|
|
"akhilesh natani" <akhileshnatani (AT) gmail (DOT) com> wrote in message
news:1158995065.279907.283880 (AT) m73g2000cwd (DOT) googlegroups.com...
| Quote: | hi sir,
sir i want to know a simple pointer concept.
Q) ..... when all of thw address are integer then why we uses the
pointer of type char,float etc.
|
A pointer is an internal address. As such, pointers are more like bit
strings than integers. For instance, on a 64 bit machine, a pointer is going
to occupy 64 bits, even if an int only occupies 32. No matter how you
regard pointers, the data type of "a pointer to an int" is some variation of
int*--not the same data type as int.
-Bill |
|
| Back to top |
|
 |
Licheng Fang Guest
|
Posted: Sat Sep 23, 2006 9:10 am Post subject: Re: POINTERS |
|
|
akhilesh natani wrote:
| Quote: | hi sir,
sir i want to know a simple pointer concept.
Q) ..... when all of thw address are integer then why we uses the
pointer of type char,float etc.
|
as far as I know, pointers need to know not only what the address is,
but also what the address is pointing to. only in this way can the
operators ++ and --, etc work properly when applied to a pointer. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|