Possible Duplicate:
Why doesn't scanf need an ampersand for strings and also works fine in printf (in C)?
In C when we use the scanf()
function to get user input, we always use the &
sign before the variable.
For example:
scanf("%d", &number);
scanf("%c", &letter);
This ensures our input is stored in proper address. But in case of a string we do not use &
.
Why is that?