Knowee
Questions
Features
Study Tools

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()

🧐 Not the exact question you are looking for?Go ask a question

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?

1/2

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.