1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Access Dynamic path/folder with ios:ofstream

Discussion in 'C' started by lighten123, Mar 23, 2010.

  1. lighten123

    lighten123 New Member

    Joined:
    Mar 23, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    For Making long description short see my case:

    Code:
    suppose,
    
    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.

    Code:
    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....
     

Share This Page