Investigate 20.6.
Why is the ampersand character
&
missing in front of firstName
and lastName
in the above scanf()
statement?
scanf()
function can be used to read a string from the user input using the %s
format specifier. By default, reading stops when white space (i.e. a space, return, etc.) is encountered. There are many options to modify this behavior so that the reading stops based on different conditions (if interested: Google).
&
missing in front of firstName
and lastName
in the above scanf()
statement?