Ali,
In VC++ look at fstream and fprintf
In VS.Net check the help topic titled
Writing Text to a File ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconwritingtexttofile.htm
>Does anybody know what the equivalent of “Set Printer To Filename” in VB or VC++ is?