Thread: opening files in a program

  1. #1
    Registered User
    Join Date
    Nov 2011
    Posts
    1

    opening files in a program

    The program I'm working on requires me to open a file containing 3 lines each containing a name followed by a number. I must open the file and read the name in. Then augment .emp to it, to match the files my instructor has. Then open the .emp file and write info to it. My question is how do i open these files, being i don't know the filename ahead of time and they are strings in my program. Any advice or critique of code would be greatly appreciated. Thank you.
    Attached Files Attached Files
    • File Type: c tim.C (2.0 KB, 110 views)
    • File Type: c tim.C (1.6 KB, 103 views)
    Last edited by senyah; 11-03-2011 at 04:17 PM.

  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,739
    You're passing by value where you should be passing by reference.
    Devoted my life to programming...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. opening php files in IE6
    By Micko in forum Tech Board
    Replies: 7
    Last Post: 03-06-2006, 01:16 PM
  2. Opening files...
    By prestomrmime in forum C Programming
    Replies: 4
    Last Post: 07-08-2003, 08:14 PM
  3. Opening Files from c++
    By snowy101 in forum C++ Programming
    Replies: 4
    Last Post: 06-26-2002, 11:33 AM
  4. opening .doc files in unix through C program
    By indira78 in forum Linux Programming
    Replies: 4
    Last Post: 11-05-2001, 12:57 PM
  5. saving files/opening files
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 10-29-2001, 10:16 PM