InterviewSolution
Saved Bookmarks
| 1. |
What is the drawback of scanf() and how can it be avoided (if any)? |
|
Answer» With a STRING of characters, scanf() will fail. A multi-word string cannot be entered into a single variable using scanf(). The GETS( ) function is USED to avoid this. When the enter key is pushed, it gets a string from the keyboard and ends it. As part of the input string, SPACES and tabs are PERMITTED. |
|