Why is it usually a bad idea to use gets()? Suggest a workaround.
The function gets() reads characters from the stdin and stores them at the provided input buffer. However, gets() will keep reading until it encounters a newline character. Unless the buffer is large enough, or the length of the line being read is known ahead of time, gets() can potentially overflow the input buffer and start overwriting memory it is not supposed to, wreaking havoc or opening security vulnerabilities.
| Is This Answer Correct ? | 1 Yes | 0 No |
What are the advantages and disadvantages of c language?
When should the const modifier be used?
Write a program which returns the first non repetitive character in the string?
Why do we use pointer to pointer in c?
What is difference between the following 2 lines…. int temp = (int)(0x00); int temp = (0x00int);
Write a program to interchange two variables without using the third variable?
17 Answers Accenture, College School Exams Tests, Infotech,
disadvantages of realloc ?
which is the best site or book for learning C...and i need the content for C..how to get the good programming skills....? can plz suggest me....
Write a program in C to reverse a number by recursive function?
Why we use stdio h in c?
What is the use of a semicolon (;) at the end of every program statement?
Explain the difference between exit() and _exit() function?