Monday, July 27, 2009

These problems are regarding Win 32 Console Application in MS C++ 6.0?

1. How to create a text file when application executes?


( if the named file already exists, application should use the existing file or


else has to create a file in a specified location)





2. How to record things on the created file?


(values, text that we enter to the application. It should not delete existing data


on the file)





3. How to retrieve data from a file? (e.g. from Access, text file (the one created before))





4. How to make a link to a file? ( to any file that is mentioned )





Please provide necessary syntax according to the order that they should arranged.


If there are any other alternative approaches (regarding MS C++) , let me know them as well.


I would really appreciate, if you can provide me some examples (example coding) as well.


If you have lots of things to mention, PLEASE MAIL TO : skr16skr@gmail.com

These problems are regarding Win 32 Console Application in MS C++ 6.0?
1. Use fstream (from %26lt;iostream%26gt;. fstream::open with flag in second parameter ios::trunc removes the files contents before proccessing, if that is what you want. Also use flag ios::out to write to it. First parameter is a C String with the path and filename included, WITH EXTENSION (in your case, .txt).





2.Use any of your standard ostream operations.





3.Use any of your standard istream operations.





4.Um, a shortcut? A DOS pipe? If you mean OPEN a file, see 1.


No comments:

Post a Comment