Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Aviance School is one of the largest web solutions platform in India for developers to learn and share their programming knowledge and build their careers.
The function gets() reads a line from stdin and stores them as a string into str until a newline character or the end-of-file is reached.
gets( <your variable-name> )
Demo code:
#include <stdio.h>
int main()
{
char str[100];
printf("Enter a website url: ");
gets(str);
printf("Website url: %s", str);
return(0);
}
Result of the above program:
Enter a website url: http://avianceschool.com
Website url: http://avianceschool.com