Mail Archives: djgpp/1997/05/02/16:16:18
Ok, I think this time I better start at the beginning...
Recently, I required a simple program to wait for 5 seconds and then
return with no error code. Ok I thought, simple. Indeed it is :
/******************************/
#include <stdio.h>
#include <stdlib.h>
int main(void) {
delay(2500);
exit(0);
}
/******************************/
The above code compiles and links correctly, and an executable file
is generated. The problems come when I try to run it.
From DOS only (no windows) the program operates correctly. It waits
for 5 seconds and then exits.
From DOS box within windows (3.11) it appears to hang the machine -
Ctrl-Alt-Del reports that the application has stopped responding to
the system. Occasionally, it hangs the entire machine - but this is
uncommon.
The same happens if it's run from file manager etc.
BUT IT'S NOT A WINDOWS PROBLEM !!!
How do I know this ? The same code operates fine in all conditions
when compiled with Borland Turbo C/C++...
WHY ??????????????????????????????
Any light to be shed ?
Thanks,
Danny.
- Raw text -