Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Why is it usually a bad idea to use gets()? Suggest a workaround.



Why is it usually a bad idea to use gets()? Suggest a workaround...

Answer / hrpynux@gmail.com

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

Post New Answer

More C Interview Questions

What are the advantages and disadvantages of c language?

0 Answers  


When should the const modifier be used?

0 Answers  


Write a program which returns the first non repetitive character in the string?

0 Answers   Expedia,


Why do we use pointer to pointer in c?

0 Answers  


What is difference between the following 2 lines…. int temp = (int)(0x00); int temp = (0x00int);

3 Answers   Bosch,


Write a program to interchange two variables without using the third variable?

17 Answers   Accenture, College School Exams Tests, Infotech,


disadvantages of realloc ?

1 Answers   HCL,


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....

2 Answers  


Write a program in C to reverse a number by recursive function?

1 Answers  


Why we use stdio h in c?

0 Answers  


What is the use of a semicolon (;) at the end of every program statement?

1 Answers  


Explain the difference between exit() and _exit() function?

0 Answers  


Categories