Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_SRC_3_19910112 - unix-stuff/ask.c
There is 1 other file named ask.c in the archive. Click here to see a list.
/*
 Authors: Andrew Lowry, Howie Kaye

 Columbia University Center for Computing Activities, July 1986.
 Copyright (C) 1986, 1987, Trustees of Columbia University in the City
 of New York.  Permission is granted to any individual or institution
 to use, copy, or redistribute this software so long as it is not sold
 for profit, provided this copyright notice is retained.
*/

#include <stdio.h>

main(argc,argv) 
char *argv[];
{
  int c,x;

  while (1) {
    printf("%s",argv[1]);
    c = getchar();
    while ((x = getchar()) != '\n')
      if (x == EOF) exit(-1);
    if ((c == 'Y') || (c == 'y')) exit(0);
    if ((c == 'N') || (c == 'n') || (c == EOF)) exit(1);
    printf("Please answer 'Y' or 'N'\n");
  }
}