What is the use of gets() in string? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the use of gets() in string?

9th Nov 2016, 8:24 AM
rashmi bansal
rashmi bansal - avatar
3 Answers
+ 2
It reads characters and stores them as a C string until a newline character or the end-of-file is reached.
9th Nov 2016, 8:45 AM
User3827
+ 2
Like this one : int myfunction(int n); The prototype of a function is a declaration of that function, it does not have the definition (body) of the finction, for example in C and C++ you do place the prototype in your header(if you have separate files) to inform the compiler that the function will be defined later in the program.
9th Nov 2016, 10:19 AM
User3827
0
can you explain it with an example?
9th Nov 2016, 8:49 AM
rashmi bansal
rashmi bansal - avatar