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 ? | 0 Yes | 0 No |
Is swift based on c?
get any number as input except 1 and the output will be 1.without using operators,expressions,array,structure.don't print 1 in printf statement
Why is main function so important?
What are keywords in c with examples?
Why do u use # before include in a C Progam?
Which of the following about automatic variables within a function is correct ? a.its type must be declared before using the variable b.they are local c.they are not initialised to zero d.they are global.
union { char ch[10]; short s; }test; test.s = 0xabcd; main() { printf("%d",ch[10]); }
How to implement a packet in C
main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }
5 Answers Vector, Vector Solutions,
int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the call zap(6) gives the values of zap [a] 8 [b] 9 [c] 6 [d] 12 [e] 15
what is the difference between getch() and getchar()?
what does keyword ‘extern’ mean in a function declaration?