out of fgets() and gets()which function is safe to use and
why in c language?



out of fgets() and gets()which function is safe to use and why in c language?..

Answer / pragati priya

The function fgets() function is safer to use. It checks the
bounds, i.e., the size of the buffer and does not cause
overflow on the stack to occur. gets() does not check the
bounds.

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Engineering AllOther Interview Questions

reverse a number ( like 1234 into 4321) using malloc in C programming

0 Answers   TCY Online,


can i learn ad. java without learned core java? java is best or .net is best for summer training?

0 Answers  


write a program to accept 25 characters and at the end display the largest and smallest among them.

0 Answers  


What is OSPF Open shortest Path First attributes?

0 Answers  


A company wants to transmit data over the telephone, but it is concerned that its phones may be tapped. All of its data is transmitted as four-digit integers. It has asked you to write a program that will encrypt its data so that the data may be transmitted more securely. Your script should read a four digit integer entered by the user in a prompt dialog and encrypt it as follows: Replace each digit by (the sum of that digit plus 7) modulus 10. Then swap the first digit with the third, and swap the second digit with the fourth. Then output XHTML text that displays the encrypted integer.

2 Answers   EDS, MMM, SCS,


program for inter process communicatin using message sharing in unix c

0 Answers  


What is the aim of Value Engineering?

0 Answers   BPCL Bharat Petroleum,


why pegging is required for deaerator in power plant nd why maintain the constant pressure in deaerator 3.5 kg/cm2.

2 Answers   Adani, Bell,


Based on the Job Description above, please indicate in details why you are a good match for this position?

0 Answers  


Why do sausages split lengthways, rather than around the circumference?

0 Answers  


what is the command to copy the contents from one directory to other directory?

2 Answers  


out of fgets() and gets()which function is safe to use and why in c language?

1 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5086)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4453)
  • Electrical Engineering Interview Questions Electrical Engineering (16638)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)