Home
About Us
Contact Us
Bookmark
Saved Bookmarks
Current Affairs
General Knowledge
Chemical Engineering
UPSEE
BSNL
ISRO
BITSAT
Amazon
ORACLE
Verbal Ability
→
Basic C Tutorial
→
Basic C Interview Questions in Basic C Tutorial
→
Out Of Fgets() And Gets() Which Function Is Safe...
1.
Out Of Fgets() And Gets() Which Function Is Safe To Use And Why?
Answer»
The 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.
The
GETS
() function does not check the bounds.
The gets() function is an insecure and careless use can lead to
ERRORS
.
Show Answer
Discussion
No Comment Found
Post Comment
Related InterviewSolutions
Define Register Variables. What Are The Advantages Of Using Register Variables?
What Are Storage Class In C?
What Is The Difference Between #define And Constant In C?
What Is The Purpose Of Main( ) Function?
What Is Static Memory Allocation And Dynamic Memory Allocation?
Explain Memory Leak?
What Is A Const Pointer?
Define Void Pointer?
What Is The Difference Between Char *a And Char A[]?
List Out Differences Between Strdup() And Strcpy()?
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply
Your experience on this site will be improved by allowing cookies. Read
Cookie Policy
Reject
Allow cookies