/* Program 10-6

   Program to read in a line of text from the terminal */

void read_line (char buffer[])
 {
  char character;
  int  i = 0;

  do
  {
   character = getchar ();
   buffer[i] = character;
   ++i;
  }
  while ( character != '\n' );

  buffer[i - 1] = '\0';
 }

main ()
{
 int  i;
 char line[81];
  for ( i = 0 ; i < 3 ; ++i )
  {
   read_line (line);
   printf ("%s\n\n", line);
  }
}


/* Program Output

This is a sample line of text.
This is a sample line of text.

abcdefghijklmnopqrstuvwkyz
abcdefghijklmnopqrstuvwkyz

runtime library routines
runtime library routines

*/
