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 is C++
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
What type is sizeof?
Tell us the difference between these two : #include"stdio.h" #include<stdio.h> define in detial.
What does %d do in c?
if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0
Do you know what is the purpose of 'extern' keyword in a function declaration?
suppose there are five integers write a program to find larger among them without using if- else
Can you pass an entire structure to functions?
what is memory leak?
what is function pointer?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none