A
Alef.Veld
Just wondering,
I sometimes use or see &ptr when passing it through a function so that
this specific function works with the actual pointer passed. But if we
just allocate memory to this pointer before, and then pass it as
func(ptr) instead of func(&ptr), what's the use of the & operator ?
Or is this just extra functionality of c. I can ofcourse imagine that
you would want to allocate memory within the function itself, in which
ofcourse the &operator is wanted.
Rgds,
alef
I sometimes use or see &ptr when passing it through a function so that
this specific function works with the actual pointer passed. But if we
just allocate memory to this pointer before, and then pass it as
func(ptr) instead of func(&ptr), what's the use of the & operator ?
Or is this just extra functionality of c. I can ofcourse imagine that
you would want to allocate memory within the function itself, in which
ofcourse the &operator is wanted.
Rgds,
alef