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? |