Looks like very old Borland code. What compiler are you using?
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
I admittedly have better things to do than to fugg around with old Borland code. This however works with the Dev-C++ compiler. I commented out the Turbo gibberish!
[php]//#include
//#include
#include // system()
#include // access to stdio.h
#include // Beep()
#define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
#define ESC 27 // escape key
int main()
{
unsigned frequency;
printf("Keep hitting the escape key to stop ...");
do
{
for (frequency = 500; frequency <= 1000; frequency += 50)
{
Beep(frequency,50);
//sound(frequency);
//delay(50);
}
for (frequency = 1000; frequency >= 500; frequency -= 50)
{
Beep(frequency,50);
//sound(frequency);
//delay(50);
}
} while(!KEY_DOWN(ESC));
//while (! kbhit());
//nosound();
system("PAUSE");
return 0;
}
[/php]
Next time ask a little nicer!!!!!
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417