home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C Programming Starter Kit 2.0
/
SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso
/
tyc
/
list10_6.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-16
|
516b
|
23 lines
/* Demonstrates using the gets() return value. */
#include <stdio.h>
/* Declare a character array to hold input, and a pointer. */
char input[81], *ptr;
main()
{
/* Display instructions. */
puts("Enter text a line at a time, then press Enter.");
puts("Enter a blank line when done.");
/* Loop as long as input is not a blank line. */
while ( *(ptr = gets(input)) != NULL)
printf("You entered %s\n", input);
puts("Thank you and goodbye");
}