gets is a function in the C standard library, declared in the header file stdio.h, that reads a line from the standard input and stores it in a buffer provided by the caller.
Welcome to CWAnswers
CWAnswers is your guide to the sprawling world wide web. The directory aims to provide a useful guide made by users. You can share your knowledge as well - simply sign up and edit your first entry. For questions just contact the team at support - at - cwanswers.com.
Weblinks for Gets
Top 10 for Gets
Things about Gets you find nowhere else.
Select content modules
GADGETS BLOG - LATEST GADGETS & KITCHEN, SPY GADGETS
Find Out Tech Gadgets NEW COOL GADGETS AND ELECTRONIC GADGETS REVIEWS, COMPUTER GADGETS, UPCOMING GADGETS AND GIZMOS, SCAM, CELL PHONES, LATEST NEW GADGETS, ...www.gadgetsblog.org/Check'd gets Blog'd
... Check'd- have started their very own blog to post freestyle poetry, news, art, pictures, etc. This blog is for artists, activists, hip-hop addicts, and ...checkd.blogspot.com/ScreenSteps gets blog-friendly
ScreenSteps gets blog-friendly. by Brett Terpstra on Mar 20th 2008 ... The blog templates are also customizable to fit your stylistic needs. ...www.tuaw.com/2008/03/20/screensteps-gets-blog-friendly/What gets blogs noticed? | Ask Metafilter
That's why those blogs have huge followings, they are mentioned regularly ... If you have a photo blog, you need to be a better than the average photographer ...ask.metafilter.com/96015/What-gets-blogs-noticedSeth's Blog: When culture gets stuck
Classical music wasn't always 'classical'. Geeks spend a lot of time worrying about the cutting ... When culture gets stuck - Seth Godin from Kempton's blog ...sethgodin.typepad.com/seths_blog/2006/09/when_culture_ge.htm...gets is a function in the C standard library, declared in the header file stdio.h, that reads a line from the standard input and stores it in a buffer provided by the caller.
Use of gets is strongly discouraged. It is left in the C89 and C99 standards for backward compatibility. Many development tools such as GNU ld emit warnings when code using gets is linked.
Implementation
It might be implemented as follows (using getchar):
}
The programmer must know a maximum limit for the number of characters gets will read so he can ensure the buffer is big enough. This is impossible without knowledge of the data. This design flaw leads to bugs and opens a gate for exploiting computer security through a buffer overflow. Many sources advise programmers to never use gets in new programs.
Alternatives
Other line input functions may be used instead of gets, so as to avoid buffer overflow bugs. A simple alternative is fgets. When replacing code of the form
one must keep in mind that the fgets(buffer, sizeof buffer, stdin) call differs from gets(buffer) not only in buffer overflow protection, but also in that fgets(buffer, sizeof buffer, stdin) preserves the terminating newline (if the input line is terminated by a newline), while gets(buffer) discards it.
Safe use
Safe use of gets requires the programmer to ensure that buffer overflows cannot be a problem. Standard C provides no way to do this; however, there are a number of relatively complicated ways to ensure it, with varying degrees of portability. One possibility is to use a guard page to protect memory. Alone, this turns exploitable buffer overflows into mere crashes. In combination with an exception handler, such as one involving SIGSEGV and sigaction, the guard page can allow graceful error handling.

























