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 |
Write a program of prime number using recursion.
WHAT IS ABSTRACT DATA TYPE
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
What is the difference between realloc() and free()
f(*p) { p=(char *)malloc(6); p="hello"; return; } main() { char *p="bye"; f(p); printf("%s",p); } what is the o/p?
What are run-time errors?
Discuss the function of conditional operator, size of operator and comma operator with examples.
Can we include one C program into another C program if yes how?
Which function in C can be used to append a string to another string?
What is the difference between fread buffer() and fwrite buffer()?
difference between loading and linking
How can you access memory located at a certain address?