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 |
Compare interpreters and compilers.
what is the output of printf("%d",(scanf("%d",10));
what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9
What are structure members?
Write a program to generate the first n terms in the series --- 9,11,20,31,...,82
What is the difference between procedural and declarative language?
What is the difference between calloc() and realloc()?
What are types of functions?
Do character constants represent numerical values?
In a byte, what is the maximum decimal number that you can accommodate?
How to write a program to receive an integer & find its octal equivalent by using for loop?
What is a far pointer in c?