/* cq.h CQ is a function which sends back a flag indicating whether the user wishes to continue the program or quit it. written by Warren M Myers 17 Nov 99 */ #ifndef CQ_H #define CQ_H #include int CQ(); int CQ(){ int qFlag = 1; /* flag passed back to determine whether or not to continue */ char cq; /* character to get input from user */ fflush(stdin); printf("\nDo you wish to continue this program or quit? \n"); printf("Press q to quit, any other character to continue "); scanf("%c",&cq); printf("\n"); if(cq=='q' || cq=='Q'){qFlag=0;} return qFlag; } #endif