I have some general comments regarding your code:
1. I am not sure if it is the forum or if it is your code, but please make sure that you use proper indention. It will help make your code more readable.
2. If you get a line of code that is very long it is often a good idea to break it up into multiple lines for readability. (there is a line in your initialize function that is very long).
3. If you have a piece of code that is potentially difficult to understand, it is a good idea to add a comment explaining what the code does so that way others (and yourself!) can understand the code in the future.
4. You do not appear to be closing your file. I am fairly sure that you should be doing this (See: http://www.cprogramming.com/tutorial/cfileio.html ). I am also not sure why you commented out your menu code.
In answer to your actual question I am not going to provide a solution but I will provide some suggestions:
1. You have combined your initialize and print methods together. You should think about separating these so that you initialize the grid to the random configuration once, but that you can print the grid multiple times.
2. Think about how you can modify your print routine to add the "cursor". Look at your specification again. Do you see anything else that you need this functionality for?
3. How can you keep track of the cursor position?
4. How can you update the console and re print the grid when the cursor position updates?
Try to answer those questions and I think your solution will become apparent.
Edited by shadowisadog, 24 November 2013 - 12:15 PM.