What is the function of gets() and puts() function.
Answers
Explanation:
C program gets() and puts() function
C program gets() and puts() functionThe gets() functions are used to read string input from the keyboard and puts() function displays it. These functions are declared in the stdio. h header file.
The gets() function enables the user to enter some characters followed by the enter key. All the characters entered by the user get stored in a character array. The null character is added to the array to make it a string. The gets() allows the user to enter the space-separated strings.
The puts() function in C/C++ is used to write a line or string to the output( stdout ) stream. It prints the passed string with a newline and returns an integer value. The return value depends on the success of the writing procedure.