#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <termios.h>
#include <unistd.h>
#include <memory.h>
int mygetch
()
{
struct termios oldt, newt;
int ch;
tcgetattr
(STDIN_FILENO, &oldt
);
newt = oldt;
newt.
c_lflag &= ~
(ICANON | ECHO
);
tcsetattr
(STDIN_FILENO, TCSANOW, &newt
);
ch = getchar
();
tcsetattr
(STDIN_FILENO, TCSANOW, &oldt
);
return ch;
}
int main
(int argc,
char *argv
[])
{
char answer;
while (answer ==
'Y' || answer ==
'y') {
printf("Continue? [Y/N] ");
answer = mygetch
();
}
printf("Exiting...\n");
return 0;
}