You have to do it in this way:
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <tchar.h>
#pragma comment (lib,"user32.lib")
enum
{
INTERVAL = 2000, MAX_COUNT = 10,
};
void FAR PASCAL __fnTimer(HWND, UINT, UINT_PTR, DWORD)
{
static int count = MAX_COUNT;
if(0>=--count) PostQuitMessage(0);
Beep(3000,100);
}
int FAR PASCAL _tWinMain(HINSTANCE h,HINSTANCE p,LPTSTR c,int sw)
{
if(0<SetTimer(0,0,INTERVAL,__fnTimer))
{
for(MSG m;GetMessage(&m,0,0,0);DispatchMessage(&m));
}
return 0;
}
i assumed youre using windows.
Good luck.