Passing file names

This is a discussion on Passing file names within the C++ Programming forums, part of the General Programming Boards category; I'm not really sure how to do this, but how do I pass a file name as a function parameter? ...

  1. #1
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728

    Passing file names

    I'm not really sure how to do this, but how do I pass a file name as a function parameter? I have an object which has a function that saves the object to file, but depending on what program calls it, it saves it do different file names.

    I've only hardcoded file names into programs before, never treated them as variables, so I'm really unsure of how this is done. Google was no real help, I only come up with simple examples of file saving.

  2. #2
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    Thanks, that works! Lot easier than I thought it was going to be

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 04:27 PM
  2. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 08:35 AM
  3. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 12:36 PM
  4. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  5. Scope And Parameter Passing
    By djwicks in forum C Programming
    Replies: 6
    Last Post: 03-28-2005, 07:26 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21