For a console game, you probably want to use curses or ncurses. (I've heard a lot about curses, but, unfortunately, I have not had the opportunity to use this library, so I cannot help you with this.)
The first thing you want to do is write a SIMPLE program the merely moves the cursor around the screen based on user's buffered input (like cin). No walls, no ghosts, no points, nothing but simple movement.
Next, change the cursor to a character or symbol to represent Pacman. Maybe you want to alternate between "C" and "O" to simulate opening and closing the mouth.
Then worry about edge conditions--what happens when you hit the top/bottom or left/right side of the screen. Then add walls. Make sure you can navigate around but not through the walls.
At this, you still have to handle the following:
+ Threading (ghosts continue to move while the program waits for your input)
+ Unbuffered input (you shouldn't have to hit enter to cause Pacman to move.)
Don't try to do them all at the same time--add them one at a time. Build up your program in pieces. Make sure you understand how each feature of the program works before adding in another. It will make it easier to debug each new feature.
Like I said, I have no experience with curses. Also, my experience with unbuffered input was decades ago in my BASIC days, so I don't have current experience there, either. However, you can google it and learn. But whatever you do, take it in steps. Finish one step before going to the next.
You may want to decide on a few other issues to consider before you begin.
Do you want a main menu, high score, 2 or more players, multiple maps.
Do you want to exit after the player dies or restart
Do you want to exit in the middle of the game, do you want to be able to pause.
Thnaks guys... i have somehow completed some steps with the help of internet and my friends.. but stuck now like how the ghost object will follow the player object...i can move the player with keyboard now...but cant move the ghost in a way where it will follow the player object..any suggestions?