Multiple choice technology programming languages

Which of the following is used to receive a single string?

  1. gets

  2. getstring

  3. Both A and B

  4. None of the Above

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

The gets() function in C reads a single line from stdin into a char array until a newline. Note that gets() is deprecated and dangerous because it doesn't check buffer boundaries, leading to buffer overflows. Use fgets() instead in production code. There is no standard C function called getstring().