Multiple choice

If a character string is to be received through keyboard, which function would work faster?

  1. getch( );

  2. gets( );

  3. getchar( );

  4. getche( );

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

gets() is a standard library function used to read a string from standard input until a newline character is encountered. It is generally faster for reading strings compared to character-by-character functions like getchar().