/*************************************************************************************/ /* File Name : background.cpp */ /* Author : Meng Yi Yee */ /* Class : CS 431 */ /* Date : Oct 20, 1999 */ /* */ /* This is the background application for the waitable timer. This program will read */ /* the client's number from the 'CreateProcess' called by the timer.exe. Basically, */ /* this program will keep looping until the user input 'y'. */ /*************************************************************************************/ #include "stdafx.h" #include #include int main(int argc, char* argv[]) { //Get a value for the number of this client from argv[1] printf ("Client %s beginning to run\n", argv[1]); //Keep looping until the user input 'y' to end the program while (TRUE) { printf ("Client[%s]: Quit (y or any other character):", argv[1]); if (getc(stdin)=='y') break; getc(stdin); //throw away NEWLINE } return 0; }