View Single Post
Old 11-03-2004, 02:25 PM   #7 (permalink)
nak-1
 
True Techie

Join Date: Apr 2004

Posts: 168

nak-1

Default

errr, quick brush up on my 'C' later....

yes it is, though I can't remember my printf formatting too well so I am assuming that bit is right. But the pointer stuff is.

& passes the address of the variable

hence the statement, p = &c, assigns the address of 'c' to the variable 'p'

* is called the indirecton operator and when applied to a pointer it accesses the variable the pointer points to. Hence d = *p would assign the value of 'c' in the above example to 'd'

You code is totally consistent with this therefore it's right.
__________________
--------------------

Nak

Is it just me, or does something smell suspicious about all this?
nak-1 is offline