Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Access Dynamic path/folder with ios:ofstream (http://www.go4expert.com/forums/access-dynamic-path-folder-iosofstream-t21470/)

lighten123 23Mar2010 20:23

Access Dynamic path/folder with ios:ofstream
For Making long description short see my case:



path: "../defult123/test.txt"

my code: ofstream fout("../defult123/test.txt",ios::out);

Here in "defult123", "default" is static but "123" is dynamic .So Basically

path should be written as: "../default***/test.txt"

So how can i access this dynamic path for writing in test.txt file.


so should be working ??
ofstream fout("../default*/test.txt")

or,do  i have to list directory fist then check for folder named "default" in sub folder? if so then how do i do that?

please be a help....

All times are GMT +5.5. The time now is 10:42.