there are errors in running of code and i stuck over here ...so help me how to resolve this issue...
#include <iostream>
//#include <conio.h>
//#include "util.h"
using namespace std;
bool GameOver;
const int width=20;
const int height=20;
enum direction {STOP=0,LEFT,RIGHT,UP,DOWN};
direction dir;
int x,y,targetX,targetY,score;
Well here's a tidied up version of your opus without changing anything, Mian Ziad.
It runs as you submitted. So the next step is to tell us what you expect it to do and why that is not what you wanted it to do.
Hint: Be as clear and specific as you can because just saying 'it doesn't work' is not a good way to be flooded with productive responses, or any at all :)