Why scanf must take the address of operator

Wazery picture Wazery · Oct 8, 2010 · Viewed 9.5k times · Source

As the title says, I always wonder why scanf must take the address of operator (&).

Answer

Michael Burr picture Michael Burr · Oct 8, 2010

Because C only has "pass-by-value" parameters, so to pass a 'variable' to put a value into, you have to pass its address (or a pointer to the variable).