file in c++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smn
    New Member
    • Mar 2008
    • 1

    file in c++

    hello guys
    i want to write a code to create a file with a name that chosen by the user like
    [code=cpp]
    int main()
    {
    string name;
    cout<<"enter the file name:";
    cin>>name;

    ifstream b (name);

    return 0;
    }
    [/code]

    is it possible to do so?
    Last edited by sicarie; Mar 18 '08, 01:17 PM. Reason: Code tags
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    Did you try running that through a compiler?

    Comment

    Working...