I know i can use fstream to create, edit and read files in c++, i also believe there is a different way wich i am unfamiliar with. but is it possible to work with files NOT in the same directory as the program? like if the program is in C:\programfiles but i want it to append something to a file in C:\filesiwanttoalter. or what ever directory??
Bladtman242
8
Junior Poster
Recommended Answers
Jump to PostYou should be able to just specify the entire path and file name as the parameter.
Jump to Postcan you not see the () on open? Its just you have two parameters inbetween them :P
You will need to escape that '\' characters
"C:\\programs\\fileneedschanges"
Then t shold work fineChris
All 8 Replies
Comatose
290
Taboo Programmer
Team Colleague
Bladtman242
8
Junior Poster
Freaky_Chris
299
Master Poster
Comatose
commented:
:)
+8
Bladtman242
commented:
well, it solved my problem
+1
Bladtman242
8
Junior Poster
Freaky_Chris
299
Master Poster
Bladtman242
8
Junior Poster
Freaky_Chris
299
Master Poster
Bladtman242
8
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.