This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: and nally a double followed by spaces, tabs, or returns. Bad User If the user types something bad, then scanf statement will fail. And the variables will contain whatever info was there before. scanf returns a value equal to the number of variables that were lled Example bad_user.c An extra & printf( %d, &age ); prints the address of age; 1245060 Forgetting the & Because we dont use & for printf and do use it for scanf, we have to be careful not to get mixed up. scanf(%d,age); stores the value that the user typed in at the location that is equal to age (not at the location of age) warning argument is not a pointer run & crash run & segmentation fault...
View Full Document
- Spring '06