Is global scope for a Filestream object (C++.NET) text file possib

Discussion in 'MCAD' started by Pete J, Jun 30, 2005.

  1. Pete J

    Pete J Guest

    I would like to create a Filestream/Streamwriter for a text log file in my
    beginning of main, and be able to access the "open" text file from any
    function in the program, without having to pass the object reference as a
    parameter to the function.

    Since many functions may call other functions, etc, it would be great if I
    can keep the object open, and write to the text file from any function,
    without having the overhead of creating another(many) local filestream
    objects, or having to pass the filestream object reference pararmeter many
    levels deep.

    The application is performance intensive, so speed is very important.

    Does anyone know how reference a file open in the 'main', or some other
    recommendation? Or is there a way to write to an open text file from
    anywhere in a mutifucntion program with speed and ease?

    Thank you.
    --
    Pete J
    Pete J, Jun 30, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Global Scope

    , Jun 11, 2005, in forum: MCSE
    Replies:
    4
    Views:
    869
  2. Morph
    Replies:
    1
    Views:
    408
    Conor
    Jan 9, 2005
  3. Hoffa
    Replies:
    0
    Views:
    671
    Hoffa
    Oct 25, 2006
  4. Hoffa
    Replies:
    1
    Views:
    1,414
    Walter Roberson
    Oct 25, 2006
  5. Giuen
    Replies:
    0
    Views:
    684
    Giuen
    Sep 12, 2008
Loading...

Share This Page