Thread: Referance Ifstream

  1. #1
    Registered User Ajsan's Avatar
    Join Date
    Dec 2003

    Referance Ifstream

    My program is being picky about being passed a referance ifstream type fin varieble that has been passed through 2 functions.

    is there something in thte referance that only allows it to be passed to one fuction and back and not to a function then from the func to another func then back then back again?

    i have been getting errors with my program opening files when the fin varieble has been past through more than one fucntion.

    all of the code works and the address of the file that i'm using is correct. when i used a ifstream vareible that was created in the function that its used in it works just fine where the other one doesn't.
    Style is overrated.

    - ₽ -

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    It should work fine. Why not post the code?

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    It should work fine.

    >>then back then back again?
    If 'back' means 'returned', you should make sure that your functions are returning references rather than values. But yeah, post some code.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple ifstream Question
    By Paul22000 in forum C++ Programming
    Replies: 8
    Last Post: 12-05-2008, 05:34 PM
  2. ifstream
    By Wraithan in forum Tech Board
    Replies: 3
    Last Post: 09-24-2006, 01:26 AM
  3. ofstream and ifstream for searching and writing
    By johnnyd in forum C++ Programming
    Replies: 6
    Last Post: 03-17-2003, 08:34 AM
  4. ifstream
    By Klinerr1 in forum C++ Programming
    Replies: 2
    Last Post: 07-22-2002, 11:18 PM
  5. Ifstream Problems
    By IlUomo in forum Windows Programming
    Replies: 1
    Last Post: 04-24-2002, 12:51 PM