Y
Hacker News
new
|
ask
|
show
|
jobs
by
wruza
3469 days ago
Otoh,
*foo
is obviously a char. Do you put a space between dereference operator and its operand?
1 comments
itsuart
3469 days ago
No, I don't. If foo is a (storage of) pointer to something, to get that something from memory I use dereference operator `* so
*foo = 'a';
will write value of 'a' into memory at address that is in foo.
type* foo;
is declaration and
*foo
is dereferencing.
link