Thread: Creating file names

  1. #1
    Registered User abrege's Avatar
    Join Date
    Nov 2002
    Posts
    369

    Creating file names

    Code:
    ofstream fout;
    string filename;
    
    cout << "Enter the name of the file: ";
    cin >> filename;
    
    fout(filename);
    How would I get something like this to work?
    I am against the teaching of evolution in schools. I am also against widespread
    literacy and the refrigeration of food.

  2. #2
    Registered User
    Join Date
    Oct 2002
    Posts
    155
    fout.open(filename);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 11:39 PM
  2. Creating File Handling Functions
    By td4nos in forum C Programming
    Replies: 6
    Last Post: 06-26-2009, 12:43 PM
  3. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 05:27 PM
  4. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-22-2008, 12:19 AM
  5. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 02:19 PM
Website Security Test