What is a potential risk of using the gets() function for reading strings in C?
- It always returns NULL
- It can lead to buffer overflow
- It doesn't exist in C
- It has a higher time complexity
The gets() function is risky because it does not perform bounds checking and can lead to buffer overflows, potentially exposing the program to security vulnerabilities.
Loading...
Related Quiz
- When using dynamic memory allocation for arrays, which standard library function is used to release the memory that was previously reserved?
- What potential problem might occur when using fseek and ftell with large binary files?
- In C, the first element of an array can be accessed using index ________.
- Enumerations provide a way to assign ________ to a set of named constants.
- Function pointers in C can be stored in an array, creating a(n) ________ of function pointers.