StringsWhich of the given function is more appropriate for reading in a multi-word string including spaces?Optionsscanf()gets()getchar()puts()
Question
StringsWhich of the given function is more appropriate for reading in a multi-word string including spaces?Optionsscanf()gets()getchar()puts()
Solution
The most appropriate function for reading in a multi-word string including spaces is gets(). This function reads a line from stdin into the buffer pointed to by s until either a terminating newline or EOF, which it replaces with a null byte ('\0'). Unlike scanf(), gets() does not stop reading input after the first whitespace character.
Similar Questions
Which of the following function is more appropriate for reading in a multi-word string? gets() puts() scanf() printf()
Which of the following function is more appropriate for reading in a multi-word string?ans.puts()scanf()gets()printf() Previous Marked for Review Next
Which of the following function is more appropriate for reading in a multi-word string?
function is more appropriate for reading in a multi-word string?ans.
Which of the following function is more appropriate for reading in a multi-word string in c?
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.