i want to know how (gets)works
No, you don't. You want to stay away from gets() entirely, in fact. The function is extremely dangerous, because it is prone to buffer overruns, and no experienced C/C++ programmer still uses it.
Well, knowing how it works and using it are entirely different.
I agree with Schol-R-LEA in that you should never use this function. However, if you want to learn how it works internally to better understand it and why you should avoid it - that is a good thing.
Look for an open source implementation of it (FreeBSD, for example: gets.c)
Edited 3 Years Ago
I am currently working on a program to track my mile for my monthly expense report for work. Everything is working great, however, I can not for the life of ...
I am trying to understand the SynchronizedMap and I ran the below code. I get the below Output with an exception. According to my understanding the exception is caused when ...
I am trying to make this form to clear after being submited. As it is now the form submits, however, the input fields do not clear and when ...