Siddu,
When a program like CVI or notepad opens a file for reading or writing, it is read from or written to in the program's memory. The actual file on disk does not change until the file is saved (notepad) or closed (CVI). The easiest thing to do is write all the text twice: use printf statements to print to the console (just like DOS) which will be done in realtime, and use either the CVI File I/O functions (OpenFile, WriteFile, etc.) or the C stdio functions (fopen, fprintf, fclose, etc.) to write to a log file. This way you can monitor the output of your program as it runs, and you will also have a log file to examine more closely.
Hope that helps.
Mert