|
|
|
© 1998 by Bobby Griggs.
// This is the first program for Computer Programming.
// The program displays "Hello World" on the monitor. After 5
// seconds, the program terminates execution. The program assumes
// that a header file called myprocs.h has been copied to the include
// directory. If the header file is in the same directory as this
// source file, then the include statement should be change to
// #include "myprocs.h".
// Win32 console application
#include < iostream.h >
#include < time.h >
#include < myprocs.h >
int main()
{
time_t Initialtime = time(NULL), delta=0;
cout << "Hello World!" << endl;
cout << "Man, this is a chingy program!" << endl;
Delay(5);
return 0;
}
Assumes the following header file.
void Delay(long);
void Delay (long delay)
{
long initialtime = time(NULL), delta = 0;
while (delta < delay)
{
delta = time(NULL) - initialtime;
}
return;
}
|